TransWikia.com

Finding format/type of the vector geometry

Geographic Information Systems Asked by Lyubomir Klyambarski on April 1, 2021

Does anybody know what format is the following element?

01000000804AE9B78F8F0D416258AE25F8E45141

It looks like WKB or PostGIS geometry/geography but I didn’t manage to convert it.

It has to be point in the centre of the city of Sofia, Bulgaria. The coordinate system should be EPSG:32635. There are some other attributes of the SRS:

FalseX=-5120900; FalseY=-9998100; XYUnits=450445547.391054; FalseZ-1000; ZUnits=2147483.645; FalseM=-100000; MUnits=10000; IsHighPrecision=1; XYTolerance=0.001; ZTolerance=0.001; MTolerance=0.001

But I don’t know if I should create user defined CRS with these elements.
The coordinates of this point given in another table are (198; 4733). If I use them with the standard EPSG:32635 the point is located far more South.

2 Answers

It seems to be an odd number of hex-couplets, so I tried adding an extra "01" (the WKB code for point geometry, I think) at the start and converting with R's wkb package:

> readWKB(list(hex2raw("0101000000804AE9B78F8F0D416258AE25F8E45141")))
SpatialPoints:
          x       y
[1,] 242162 4690913
Coordinate Reference System (CRS) arguments: NA 

Saving that in an object with EPSG:32635 and then converting to 4326 (lat-long) gives me a point which is indeed in Sofia:

> pts = readWKB(list(hex2raw("0101000000804AE9B78F8F0D416258AE25F8E45141")))
> proj4string(pts)=CRS("+init=epsg:32635")
> spTransform(pts, CRS("+init=epsg:4326"))
SpatialPoints:
            x        y
[1,] 23.87071 42.32777
Coordinate Reference System (CRS) arguments: +init=epsg:4326
+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 

So somehow an "01" has been chopped off the start of the hexadecimal WKB representation.

Answered by Spacedman on April 1, 2021

With the help of Spacedman, you can use the QuickWKT plugin to get the point into QGIS.

Enter 0101000000804AE9B78F8F0D416258AE25F8E45141 in the input box and select Point (WKB) as Data type. The result is near the town of Momin Prohod.

Converting WKT to WKB in Java using PostGIS? gives a few more hints on WKB to WKT conversion.

BTW the coordinates (198; 4733) are Sofia City in UTM 35N, but in kilometers instead of meters.

Answered by AndreJ on April 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP