0

Problem is importing VFK (Czech cadastrial data format) into PostgreSQL by ogr2ogr.

Versions are:

PostgreSQL: 12

PostGIS: 2.5.3

GDAL: 3.0.2

Command is:

ogr2ogr -overwrite -f "PostgreSQL" PG:"host=localhost user=sa dbname=top_secret password=****" "C:\Users\001-PC\Desktop\601977.vfk"

VFK file is aviable to download here

Data was imported, but SELECTING buildings geometry not works. Returns only weird lines.

SQL query:

SELECT sbp.wkb_geometry FROM public.ob AS ob
INNER JOIN public.sbp AS sbp ON ob.id = sbp.ob_id
WHERE bud_id = 404332805

IN PostgreSQL version 9.2, PostGIS 2.0, GDAL 2.3.3 is SELECTION of buildigs geometry working correctly.

Bad geometry screenshot:

enter image description here

Bad WKT geometry:

"LINESTRING(-541971.66 -1113748.07,-541973.54 -1113749.16)"
"LINESTRING(-541971.66 -1113748.07,-541968.98 -1113753.35)"
"LINESTRING(-541968.98 -1113753.35,-541964.98 -1113751.41)"
"LINESTRING(-541964.98 -1113751.41,-541964.53 -1113752.31)"
"LINESTRING(-541964.53 -1113752.31,-541959.83 -1113750.03)"
"LINESTRING(-541959.83 -1113750.03,-541962.93 -1113743.76)"
"LINESTRING(-541965.97 -1113737.6,-541962.93 -1113743.76)"
"LINESTRING(-541962.29 -1113735.75,-541965.97 -1113737.6)"
"LINESTRING(-541962.29 -1113735.75,-541957.34 -1113745.6)"
"LINESTRING(-541957.34 -1113745.6,-541952.64 -1113754.98)"
"LINESTRING(-541952.64 -1113754.98,-541967.38 -1113762.3)"
"LINESTRING(-541971.17 -1113754.33,-541967.38 -1113762.3)"
"LINESTRING(-541973.54 -1113749.16,-541971.17 -1113754.33)"

Right geometry screenshot:

enter image description here

Right WKT geometry:

"LINESTRING(17.3119314037153 49.6675178674764,17.3119069687544 49.6675064537858)"
"LINESTRING(17.3119314037153 49.6675178674764,17.311975535633 49.6674729891621)"
"LINESTRING(17.311975535633 49.6674729891621,17.3120280408433 49.6674938809611)"
"LINESTRING(17.3120280408433 49.6674938809611,17.312035469319 49.6674862252217)"
"LINESTRING(17.312035469319 49.6674862252217,17.3120971623118 49.6675107775252)"
"LINESTRING(17.3120971623118 49.6675107775252,17.3120458931109 49.6675641434376)"
"LINESTRING(17.3119956006582 49.6676165780416,17.3120458931109 49.6675641434376)"
"LINESTRING(17.3120438168794 49.6676363818956,17.3119956006582 49.6676165780416)"
"LINESTRING(17.3120438168794 49.6676363818956,17.3121254621581 49.6675526161264)"
"LINESTRING(17.3121254621581 49.6675526161264,17.3122030210656 49.6674728350539)"
"LINESTRING(17.3122030210656 49.6674728350539,17.3120097722175 49.6673943179491)"
"LINESTRING(17.311946677264 49.6674622859676,17.3120097722175 49.6673943179491)"
"LINESTRING(17.3119069687544 49.6675064537858,17.311946677264 49.6674622859676)"
  • I wrote and deleted an answer for the case you were referring to the geometry column output. If you are referring to the actual shape of your geometries, please add an image of what you mean by 'weird lines'. GDAL 2.3.3 produces seemingly correct results, like you mention. – geozelot Mar 20 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.