Hello! I am a full-stack TypeScript developer based near Sydney Australia.
martywallace / polyk Goto Github PK
View Code? Open in Web Editor NEWA JavaScript tool for working with polygons.
Home Page: http://polyk.ivank.net/
License: MIT License
A JavaScript tool for working with polygons.
Home Page: http://polyk.ivank.net/
License: MIT License
Hello! I am a full-stack TypeScript developer based near Sydney Australia.
Could you clarify how the project is being maintained, and if it's a goal to go beyond Ivan's PolyK library that he distributes from http://polyk.ivank.net/ ? I imagine this is basically a copy of Ivan's original source licensed via MIT with tests added and maybe other improvements. It's nice to see it on Github and NPM, which I understand Ivan wasn't too keen to do.
Thank you for adding the tests. I wouldn't have considered using the library without seeing these.
Just published a new release 0.24.0
.
Could you test your applications that depend on it.
There's also an easy CDN URL that you can simply import into your HTML page.
<script src="https://unpkg.com/polyk/dist/polyk.min.js"></script>
Also looks like the bower works.
$ bower install polyk -f
bower resolve https://github.com/MartyWallace/PolyK.git#*
bower download https://github.com/MartyWallace/PolyK/archive/0.24.0.tar.gz
bower extract polyk#* archive.tar.gz
bower resolved https://github.com/MartyWallace/PolyK.git#0.24.0
bower install polyk#0.24.0
polyk#0.24.0 bower_components/polyk
Close this issue whenever you've successfully tested the bower build.
For a geo-processing library, it would be nice to include some tests, even if they are very basic unit testing. At least it would show that the obvious test cases are covered and if someone has any issues with more complex scenarios they could simply just submit a PR with the test case failing.
I'm happy to help to build the initial tests using jest
(preferred) or tape
.
Should be as easy as something like:
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined) {
// Export PolyK.
}
Once #2 is merged, publish to registry.
[Request] how to implement advanced slice with multiple line ?
https://cloud.githubusercontent.com/assets/748320/19797937/a4d377a6-9d20-11e6-872d-f977ac11690b.png
Slice ( p : Array, ax : Number, ay : Number, bx : Number, by : Number ):Array//current version
Slice ( p : Array, lines:Array):Array//hope version
We have the original polygons (counties) and the polylines to be used for splitting (highways). What if instead of trying to split the county polygons with the highway polylines we go a step back - get the counties boundaries (Polylines), merge them with the highways (Polylines) and use the merged dataset to build a brand new polygon dataset. Then we can get the original attributes from the County polygons to the resulting dataset with a simple Spatial Join.
Result Polygons:
const polyk = require("polyk")
const vertices = [ 1, 1,
5, 5,
5, 0,
4, 2 ]
const [ s1, s2 ] = [ 0, 2 ]
const [ e1, e2 ] = [ 9, 2 ]
polyk.Slice(vertices, s1, s2, e1,e2)
results in TypeError: Cannot set properties of undefined (setting 'flag')
in index.js line 241.
Hi,
My understanding of the issimple function is it returns false if the polygon is self-intersecting and true if not.
For co-ordiantes
0,0 , 25,25, 12,12, 11,30 it returns false which is what I expect.
however for 0,0 25, 25, 12,12 10, -15 it give false as well. I think it should be true.
even co-oridnates 0,0 25,25 ,12, 12 10,0, 0,0 is coming as false.
Could you please help with what is going on here?
Regards,
Ajay
You don't need to publish your dist/
folder in the GitHub repo, all the files published via npm can be accessed here https://unpkg.com/[email protected]/.
Add dist
to your .gitignore
.
Also noticed your polyk-min.js
is not published.
https://unpkg.com/[email protected]/dist/
To make sure specific files are included in your npm publish package, you can specify in your package.json
.
"files": [
"index.js",
"dist"
],
I have a Haxe port it obviously can be used in js, python, c#, c++, jvm, java, php, lua...
https://github.com/nanjizal/hxPolyK
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.