Search options

Search operator:
Find:
At least one word (OR)
All words (AND)
Exact expression (Phrase)
Semantic search & fuzzy search
Also find:

Import status: Running file import (still 2 documents to extract)

Because of yet running and open tasks like text extraction and analysis maybe not all results were found yet, since at the moment of this search 2 file(s) could be only searched, overviewed and filtered by their file names only, not yet by their content and/or content based facets/filters!

You can prioritize the import(s) of (a) not yet processed file(s) by click on "Prioritize import" in the list view.



2022-02-24T04:00:00Z
ad_edge_tmp.cpp
:

#include "ad_edge_tmp.h"

namespace maps::renderer::denormalization {

namespace {

/**
* For ad belonging to alternative hierarchy we compute symmetric difference of
* edges in ad and it's patches.
*
* Input data requirement for (A exclude B) operation:
* area(A intersection (complement B)) = area(B \setminus A) = 0
* We can't handle situation when something not belonging to country area is subtracted from it.
*
* Input data requirement for (A include B) operation:
* area(A intersection B) = area(A \cap B) = 0
* We can't handle situation when something is added to country area twice.
*
* We can't use face_id-s here.
* ad_face_patch table may use face_id-s other than used in original ad.
* E.g. original ad is one big face with area of whole country,
* but subtracted patch is another face with only small part of it.
*
* WARN: this logic doesn't work for non-topological input data
* (
* e. g. for Navteq-provided Europe
* converted using current version of rdf_ymapsdf converter
* )
* WARN: as a result, we are unable to map set of edges belonging to a single ad
* into a set of faces. There is no "face" object for
* Ukraine with Crimea included (topologically it's the same connected space)
*/

const std::string DATA_QUERY = R"(
-- Maps ad into set of edges for general hierarchy version of this ad
-- Simply joins ad -> ad (on g_ad_id) -> ad_face -> face_edge

$ad_g_edge = (
SELECT
ad.ad_id AS ad_id,
face_edge.edge_id AS edge_id,
COUNT (*) AS include_count
FROM {ad} AS ad
INNER JOIN {ad} AS g_ad
ON g_ad.ad_id = ad.g_ad_id
INNER JOIN {ad_face} AS ad_face
ON ad_face.ad_id = g_ad.ad_id
INNER JOIN {face_edge} AS face_edge
ON face_edge.face_id = ad_face.face_id
GROUP BY ad.ad_id, face_edge.edge_id
);

-- Maps ad into edges being either added or removed
-- from it's geometry due to boundary dispute.

$ad_patch_edge = (
SELECT
ad.ad_id AS ad_id,
face_edge.edge_id AS edge_id,
COUNT (is_excluded = false OR NULL) AS include_count,
COUNT (is_excluded = true OR NULL) AS exclude_count
FROM {ad} AS ad
INNER JOIN {ad_face_patch} AS ad_face_patch
ON ad_face_patch.ad_id = ad.ad_id
INNER JOIN {face_edge} AS face_edge
ON face_edge.face_id = ad_face_patch.face_id
GROUP BY ad.ad_id, face_edge.edge_id
);

INSERT INTO {ad_edge_tmp}

-- ad belonging to general hierarchy
SELECT
ad.ad_id AS ad_id,
face_edge.edge_id AS edge_id
FROM {ad} AS ad
INNER JOIN {ad_face} AS ad_face
ON ad_face.ad_id = ad.ad_id
INNER JOIN {face_edge} AS face_edge
ON face_edge.face_id = ad_face.face_id
WHERE ad.g_ad_id IS NULL
GROUP BY ad.ad_id, face_edge.edge_id
HAVING COUNT (*) % 2 <> 0

UNION ALL

-- ad belonging to alternative hierarchy
SELECT
COALESCE(ad_g.ad_id, ad_alt.ad_id) AS ad_id,
COALESCE(ad_g.edge_id, ad_alt.edge_id) AS edge_id
FROM $ad_g_edge AS ad_g
FULL OUTER JOIN $ad_patch_edge AS ad_alt
USING (ad_id, edge_id)
WHERE
COALESCE(ad_g.ad_id, ad_alt.ad_id) in (
SELECT ad_id FROM {ad} WHERE g_ad_id IS NOT NULL
)
AND (COALESCE(ad_g.include_count, 0) +
COALESCE(ad_alt.include_count - ad_alt.exclude_count, 0)) % 2 <> 0
)";

} // namespace

AdEdgeTmpTask::AdEdgeTmpTask()
: SqlQueryTask(
"AdEdgeTmpTask",
Table{
"ad_edge_tmp",
{columns::common::ad_id().key(), columns::int64_("edge_id").key()},
},
DATA_QUERY,
{"ad", "ad_face", "ad_face_patch", "face_edge"},
{})
{ }

} // namespace maps::renderer::denormalization

Hashtags

#include

Filename extension

cpp
Content-Encoding:
ISO-8859-1

Content-Length:
3812

file_modified_dt:
2022-02-24T04:00:00Z

id:
maps/renderer/denormalization/lib/tasks/impl/ad_common/ad_edge_tmp.cpp

path0:
maps

path1:
renderer

path2:
denormalization

path3:
lib

path4:
tasks

path5:
impl

path6:
ad_common

path_basename:
ad_edge_tmp.cpp

resourceName:
b'ad_edge_tmp.cpp'

etl_file_b:
1

etl_enhance_mapping_id_time_millis_i:
0

etl_enhance_mapping_id_b:
1

etl_filter_blacklist_time_millis_i:
0

etl_filter_blacklist_b:
1

etl_filter_file_not_modified_time_millis_i:
2

etl_filter_file_not_modified_b:
1

etl_enhance_extract_text_tika_server_ocr_enabled_b:
1

etl_count_images_yet_no_ocr_i:
0

etl_enhance_ocr_descew_b:
1

etl_enhance_pdf_ocr_b:
1

etl_enhance_extract_text_tika_server_time_millis_i:
3

etl_enhance_extract_text_tika_server_b:
1

etl_enhance_detect_language_tika_server_time_millis_i:
2

etl_enhance_detect_language_tika_server_b:
1

etl_enhance_contenttype_group_time_millis_i:
0

etl_enhance_contenttype_group_b:
1

etl_enhance_pst_time_millis_i:
0

etl_enhance_pst_b:
1

etl_enhance_csv_time_millis_i:
0

etl_enhance_csv_b:
1

etl_enhance_file_mtime_time_millis_i:
0

etl_enhance_file_mtime_b:
1

etl_enhance_path_time_millis_i:
0

etl_enhance_path_b:
1

etl_enhance_extract_hashtags_time_millis_i:
0

etl_enhance_extract_hashtags_b:
1

etl_enhance_warc_time_millis_i:
0

etl_enhance_warc_b:
1

etl_enhance_zip_time_millis_i:
0

etl_enhance_zip_b:
1

etl_clean_title_time_millis_i:
0

etl_clean_title_b:
1

etl_enhance_annotations_time_millis_i:
3

etl_enhance_annotations_b:
1

etl_enhance_multilingual_time_millis_i:
0

etl_enhance_multilingual_b:
1

etl_enhance_regex_time_millis_i:
0

etl_enhance_regex_b:
1

etl_time_millis_i:
14

X-TIKA_Parsed-By:
  • org.apache.tika.parser.CompositeParser
  • org.apache.tika.parser.DefaultParser
  • org.apache.tika.parser.csv.TextAndCSVParser


X-TIKA_Parsed-By-Full-Set:
  • org.apache.tika.parser.CompositeParser
  • org.apache.tika.parser.DefaultParser
  • org.apache.tika.parser.csv.TextAndCSVParser


X-TIKA_content_handler:
ToTextContentHandler

X-TIKA_parse_time_millis:
1

X-TIKA_embedded_depth:
0

etl_enhance_pdf_ocr_time_millis_i:
0




Searching ...