Code Monkey home page Code Monkey logo

wkb-parser's Issues

Deprecated Warning on PHP 8.1.0

PHP Deprecated:  Implicit conversion from float 0.001 to int loses precision in /work/backend/vendor/geo-io/wkb-parser/src/Parser.php on line 74
PHP Deprecated:  Implicit conversion from float 0.001 to int loses precision in /work/backend/vendor/geo-io/wkb-parser/src/Parser.php on line 79

Using geo-io/wkb-parser v1.0.1, required by mstaack/laravel-postgis, on PHP 8.1.0.

Release a proper version

Hey,

I'm using wkb-parser (and wkb-interface) in a project of mine.
So far it's been working great, but since you haven't released a proper version, I have to set minimum-stability to dev in my composer.json in all my projects where I want to use my own package.

Any chance you can release a proper stable release? Your test coverage is great, and I've not had any major issues so far.

Parsing MultiPolygons

I'm getting an error when I try to parse MultiPolygons from my database. Error message is:

ParserException in Parser.php line 43: Parsing failed: $polygons must contain at least two entries

Here's an example of WKB data that's throwing the error:

01060000C00100000001030000C0010000001E000000774EB340BB0D54C02711E15F04C5394000000000000000000000000000000000E09C11A5BD0D54C04D4BAC8C46C6394000000000000000000000000000000000A7E67283A10D54C02ECA6C9049C63940000000000000000000000000000000003673486AA10D54C0A148F7730AC63940000000000000000000000000000000007F33315D880D54C00B630B410EC6394000000000000000000000000000000000D84AE82E890D54C01B2B31CF4AC639400000000000000000000000000000000019AF7955670D54C0185B087250C6394000000000000000000000000000000000D102B4AD660D54C093FE5E0A0FC6394000000000000000000000000000000000902E36AD140D54C06A882AFC19C63940000000000000000000000000000000003718EAB0C20C54C0068200193AC639400000000000000000000000000000000027F56569A70C54C0161747E526C639400000000000000000000000000000000086E3F90CA80C54C0B537F8C264C63940000000000000000000000000000000003EEDF0D7640C54C033DE567A6DC63940000000000000000000000000000000003830B951640C54C0BFB854A52DC6394000000000000000000000000000000000BEA4315A470C54C0FA7DFFE6C5C539400000000000000000000000000000000010EB8D5A610C54C0E90E62670AC5394000000000000000000000000000000000C19140834D0C54C08D0B0742B2C439400000000000000000000000000000000074452921580C54C0DC12B9E00CC239400000000000000000000000000000000004CB1132900C54C0587380608EC239400000000000000000000000000000000080B56AD7840C54C0FB3F87F9F2C23940000000000000000000000000000000004227840EBA0C54C08C683BA6EEC2394000000000000000000000000000000000B0045262D70C54C04276DEC666C3394000000000000000000000000000000000A583F57F0E0D54C00B7C45B75EC339400000000000000000000000000000000070287CB60E0D54C0B3EF8AE07FC3394000000000000000000000000000000000E52A16BF290D54C09B3C65355DC3394000000000000000000000000000000000AE2B6684B70D54C048F949B54FC33940000000000000000000000000000000000CE6AF90B90D54C0F78F85E810C4394000000000000000000000000000000000DC2DC901BB0D54C0651A4D2EC6C439400000000000000000000000000000000003931B45D60D54C0145CACA8C1C4394000000000000000000000000000000000774EB340BB0D54C02711E15F04C5394000000000000000000000000000000000

Error when parsing empty GeometryCollection

Hi, I'm trying to parse an empty geometery collection from a mysql db.

$parser->parse('00000000010700000000000000');

but it throws a ParserException: Parsing failed: Not enough bytes left to fulfill 1 double.

MySQL parse point data error: Bad endian byte value 230

Project Info

  • geo-io/wkb-parser: v1.0.2
  • PHP 8.0.16
  • MySQL 8.0.28

Description

First I save some point data with the following query ST_PointFromText(POINT(90 180), 4326). Why MySQL expects the latitude first and then the longitude is beyond me, because latitude represents a Y coordinate and longitude an X coordinate. I therefore would expect a point to be defined as X Y. But that seems to be the case, because otherwise MySQL throws an error, so I just roll with it.
Then I retrieve that (raw) data back from the database and pass it on to GeoIO\WKB\Parser\Parser::parse. This throws the following exception:

GeoIO\WKB\Parser\Exception\ParserException : Parsing failed: Bad endian byte value 230.

Any idea what I'm doing wrong and how I can fix this?

Cannot parse multipoint

Here is the WKB:

0104000020E61000000700000001010000000000000000C050C000000000000022C0010100000000000000000037C00000000000804A4001010000000000000000C05440000000000000334001010000000000000000003640000000000080524001010000000000000000002C400000000000C054C0010100000000000000006062C00000000000004640010100000000000000008042C00000000000804BC0

The error I get is:

[GeoIO\WKB\Parser\Exception\ParserException]
Parsing failed: SRID mismatch between "2D" and expected "2D".

in postgres, I get the following:

                          st_astext                           |                                                                                                                                                           spatial_data                                                                                                                                                           
--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 MULTIPOINT(-67 -9,-23 53,83 19,22 74,14 -83,-147 44,-37 -55) | 0104000020E61000000700000001010000000000000000C050C000000000000022C0010100000000000000000037C00000000000804A4001010000000000000000C05440000000000000334001010000000000000000003640000000000080524001010000000000000000002C400000000000C054C0010100000000000000006062C00000000000004640010100000000000000008042C00000000000804BC0

Removing

        if ($this->srid && $srid !== $this->srid) {
            throw new \RuntimeException(sprintf(
                'SRID mismatch between %s and expected %s.',
                json_encode($dimension),
                json_encode($this->dimension)
            ));
        }

from Parser.php eliminates the problem, but I'm guessing that is less than ideal.

Please let me know if you need more information.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.