Giter Site home page Giter Site logo

wkb_parser's Introduction

This parser support WKB and EWKB for 2d and 3d geometry.


'SRID=4326;POINT(0 1 2)'
wkb_parser:parse_hex("01010000A0E61000000000000000000000000000000000F03F0000000000000040").
{4326,{'Point',{0.0,1.0,2.0}}}

'MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0),(2 2, 2 6, 6 4, 2 2)),((60 60, 60 50, 70 40, 60 60)))'
wkb_parser:parse_hex("000000000600000002000000000300000002000000050000000000000000000000000000000040240000000000000000000000000000402400000000000040240000000000000000000000000000402400000000000000000000000000000000000000000000000000044000000000000000400000000000000040000000000000004018000000000000401800000000000040100000000000004000000000000000400000000000000000000000030000000100000004404E000000000000404E000000000000404E000000000000404900000000000040518000000000004044000000000000404E000000000000404E000000000000").
{none,{'MultiPolygon',[{'Polygon',[[{0.0,0.0},
                                    {10.0,0.0},
                                    {10.0,10.0},
                                    {0.0,10.0},
                                    {0.0,0.0}],
                                   [{2.0,2.0},{2.0,6.0},{6.0,4.0},{2.0,2.0}]]},
                       {'Polygon',[[{60.0,60.0},
                                    {60.0,50.0},
                                    {70.0,40.0},
                                    {60.0,60.0}]]}]}}



'GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(1 2,3 4),POLYGON((0 0,10 0,10 10,0 10,0 0),(2 2,2 6,6 4,2 2)),MULTIPOINT(0 0,10 0,10 10,0 10,0 0),MULTILINESTRING((0 0,10 0,10 10,0 10,10 20),(2 2,2 6,6 4,20 2)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(2 2,2 6,6 4,2 2)),((60 60,60 50,70 40,60 60))))'

wkb_parser:parse_hex("010700000006000000010100000000000000000000000000000000000000010200000002000000000000000000F03F00000000000000400000000000000840000000000000104001030000000200000005000000000000000000000000000000000000000000000000002440000000000000000000000000000024400000000000002440000000000000000000000000000024400000000000000000000000000000000004000000000000000000004000000000000000400000000000000040000000000000184000000000000018400000000000001040000000000000004000000000000000400104000000050000000101000000000000000000000000000000000000000101000000000000000000244000000000000000000101000000000000000000244000000000000024400101000000000000000000000000000000000024400101000000000000000000000000000000000000000105000000020000000102000000050000000000000000000000000000000000000000000000000024400000000000000000000000000000244000000000000024400000000000000000000000000000244000000000000024400000000000003440010200000004000000000000000000004000000000000000400000000000000040000000000000184000000000000018400000000000001040000000000000344000000000000000400106000000020000000103000000020000000500000000000000000000000000000000000000000000000000244000000000000000000000000000002440000000000000244000000000000000000000000000002440000000000000000000000000000000000400000000000000000000400000000000000040000000000000004000000000000018400000000000001840000000000000104000000000000000400000000000000040010300000001000000040000000000000000004E400000000000004E400000000000004E400000000000004940000000000080514000000000000044400000000000004E400000000000004E40").

{none,{'GeometryCollection',[{'Point',{0.0,0.0}},
                             {'LineString',[{1.0,2.0},{3.0,4.0}]},
                             {'Polygon',[[{0.0,0.0},
                                          {10.0,0.0},
                                          {10.0,10.0},
                                          {0.0,10.0},
                                          {0.0,0.0}],
                                         [{2.0,2.0},{2.0,6.0},{6.0,4.0},{2.0,2.0}]]},
                             {'MultiPoint',[{'Point',{0.0,0.0}},
                                            {'Point',{10.0,0.0}},
                                            {'Point',{10.0,10.0}},
                                            {'Point',{0.0,10.0}},
                                            {'Point',{0.0,0.0}}]},
                             {'MultiLineString',[{'LineString',[{0.0,0.0},
                                                                {10.0,0.0},
                                                                {10.0,10.0},
                                                                {0.0,10.0},
                                                                {10.0,20.0}]},
                                                 {'LineString',[{2.0,2.0},{2.0,6.0},{6.0,4.0},{20.0,2.0}]}]},
                             {'MultiPolygon',[{'Polygon',[[{0.0,0.0},
                                                           {10.0,0.0},
                                                           {10.0,10.0},
                                                           {0.0,10.0},
                                                           {0.0,0.0}],
                                                          [{2.0,2.0},{2.0,6.0},{6.0,4.0},{2.0,2.0}]]},
                                              {'Polygon',[[{60.0,60.0},
                                                           {60.0,50.0},
                                                           {70.0,40.0},
                                                           {60.0,60.0}]]}]}]}}

wkb_parser's People

Contributors

ggrise avatar

Stargazers

Oscar Moreno avatar AlexanderT avatar Anupam <|> अनुपम avatar  avatar Paul Peter Flis avatar  avatar Gleb Peregud avatar

Watchers

 avatar James Cloos avatar

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.