mb0 / wkt Goto Github PK
View Code? Open in Web Editor NEWPackage wkt implements a simplified parser for Well Known Text in Go
License: BSD 2-Clause "Simplified" License
Package wkt implements a simplified parser for Well Known Text in Go
License: BSD 2-Clause "Simplified" License
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
.
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
(the .output are the stack traces associated with the input of the corresponding file, I've fitered out the parts related to navitia-types)
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.