Giter Club home page Giter Club logo

wkt's People

Contributors

mb0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

brechtvm eklyuzin

wkt's Issues

scanContinue, scanStart and scanCoord panics on invalid input.

While writing navitia-types I discovered that given abnormal inputs, one of these three functions (and possibly more, I haven't thoroughly checked) panics, unwinding into a panic of wkt.Parse.

Example inputs

  • MULTIPOLYGON(((-11.33535 51.29165,0,0,-11.33535 51.29165))
  • MULTIPOLYGON((
  • MULTIPOLYGON(((-11.33535 51.29165,0,0,-11.33535 51.29165)
  • MULTIPOLYGON(
  • POLYGON(
  • MULTIPOLYGON(((0

Stack traces

See this zip

(the .output are the stack traces associated with the input of the corresponding file, I've fitered out the parts related to navitia-types)

How to walk through parsed string to get points

Hello...
First.. thanks for this.. a WKT library is exactly what I need. However, I am having a hard time seeing what to do at a point. I have WKT string:

MULTIPOINT(2.9283 67.225,2.9283 67.225,2.93 67.22,2.93 67.22,2.93 67.22,1.0333 67.715,4.5767 66.6783,4.5767 66.6783)

using geom, err := wkt.Parse([]byte(track)) where track is the above WKT string.
I can parse it and then a log.Printf("GEOM: %v \n\n", geom)
gives me

2016/02/18 14:35:08 GEOM: &{[{2.9283 67.225 0 0} {2.9283 67.225 0 0} {2.93 67.22 0 0} {2.93 67.22 0 0} {2.93 67.22 0 0} {1.0333 67.715 0 0} {4.5767 66.6783 0 0} {4.5767 66.6783 0 0}] 0}

Is this some way I can walk through these items so I can pull out the lat/longs and put them into a geojson file I am building with some other code? I can't range on the type wkt.Geom object given it's a struct. I am not even sure how the log is printing out the above points to be honest.

any help would be much appreciated...

Thanks!
Doug

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.