Comments (3)
geoPHP::load($wkbString)->out('wkt');
But keep in mind, that geoPHP's WKB adapter is buggy and sometimes crashes. I had completely rewrite the WKB adapter in my fork supporting every OGC type and EWKB too. Give a try: https://github.com/funiq/geoPHP
from geophp.
i have this
require 'geoPHP.inc';
$dbString1='0xE61000000104060000004A5429C0E349424010806D3742964D4040038179E2494240BC8752993B964D407543AEF8E1494240BB1A3C373B964D40D29E7A81DF494240BDC654F23B964D409EE3FDE0E04942406CEB561143964D404A5429C0E349424010806D3742964D4001000000020000000001000000FFFFFFFF0000000003';
geoPHP::load($dbString1)->out('wkt');
but give me error:
Fatal error: Uncaught Error: Call to a member function out() on boolean in E:\xampp\htdocs\golbahar\test\test.php:4 Stack trace: #0 {main} thrown in E:\xampp\htdocs\golbahar\test\test.php on line 4
from geophp.
Because it is an invalid WKB.
At first, remove the unneeded 0x prefix, then we get a hex string.
Then look at the first byte: E6100000 = 4326 in decimal, so it is an EWKB and the geometry is in EPSG:4326. Its nice, but the first 10 bit (endianness and geometry type) is missing. From the EPSG code, we know that the string is little endian coded, and we can try to guess the type mask. For that, the have to investigate in the remaining part. Geometries are built from UInt32 and Double (64 bit) values, thus the remaining part must be divisible by 32. The string is 248 character which is 31 UInt32 value, hooray. Its too long to be a single point, so it must be some collection. Then the next UInt32 value (01040600) is the number of geometries. But if we convert 01040600 to decimal, we get a huge number: 394241. Its certainly bad.
At this point, we have to stop guessing. Your string is not a WKB and cannot be recover.
from geophp.
Related Issues (20)
- How to use contains method ? HOT 3
- Convert distance (spatial reference) to meters ? HOT 4
- GPX to KML conversion problem
- Example for re-projecting from one reference frame to another? HOT 1
- Intersects, Crosses, Contains not working HOT 4
- union return null HOT 5
- Could not install in laravel 7
- Cannot construct Point. x and y should be numeric: trim coordinates HOT 2
- Any Tutorial for Windows Users? HOT 2
- error install php-geos on Centos 7
- New GEOS web site
- Check intersect of rotated rectangles
- How to install GEOS-php extension on windows ?
- Fix PHP 8.1 compatibility HOT 2
- Is there an equivalent to python's library shapely function split()?
- Can not execute geos-php on Amazon Linux2 with php7.4 or php8.0 HOT 1
- any URL with a ?url=xxx parameter generates a 429 error(!)
- geoPHP/tests/postgis.php use PHP short tag
- Forks HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geophp.