-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create an Polygon Object from list of CLLocationCoordinate2D #67
Comments
For more info on |
I fixed the issues you addressed but it still does not work for some reason.
|
@vfn |
@SebastianBoldt it works because then your first and last point will be the same, closing the polygon. You must add the first point as the last one to make a closed shape/polygon |
|
Ok, now I get it. Everything works as expected. |
Hey Guys,
I am currently trying to create Geometry Objects from a list a CLLocationCoordinate2D-Objects.
This is my approach:
The joined String could look like this:
"POLYGON((51.0693791021764 9.75201444533336, 51.1328987236114 9.67614867733331, 51.2121755537486 9.58763861466671, 51.2517628689227 9.56235002533339, 51.2913161313519 9.53706143599998, 51.3466335100652 9.52441714133342, 51.4334260815772 9.51177284666666, 51.5200540729691 9.48648425733335, 51.6457648636909 9.46119566800003, 51.7554766499544 9.42326278399996, 51.8414922247152 9.39797419466664, 51.9585218712106 9.39797419466664, 52.0052483952469 9.39797419466664, 52.0519261862681 9.4106184893334, 52.1063220425348 9.44855137333327, 52.1373756320464 9.499128552, 52.1528943136927 9.52441714133342, 52.168407587594 9.57499432000005, 52.1761621968738 9.61292720400002, 52.1916673605595 9.67614867733331, 52.2304066207189 9.8278802133333, 52.2768491510004 9.99225604400005, 52.3000521840339 10.1692761693334, 52.3232430657399 10.3210077053333, 52.3232430657399 10.4600949466667, 52.3232430657399 10.599182188, 52.3232430657399 10.6876922506667, 52.3232430657399 10.8141351973333, 52.3155141218271 10.864712376, 52.2923191899635 10.940578144, 52.2613737103096 10.9911553226667, 52.2381504193787 11.016443912, 52.2226614710605 11.0417325013333, 52.1761621968738 11.09230968, 52.1373756320464 11.1175982693334, 52.0985552641519 11.1555311533334, 52.036372336149 11.206108332, 51.9585218712106 11.2440412160001, 51.9039459736845 11.2566855106666, 51.8571137937767 11.2819741, 51.7711280511801 11.2946183946667, 51.6692969280776 11.2946183946667, 51.5750953384108 11.2946183946667, 51.512185598856 11.2946183946667, 51.4649462056936 11.2946183946667, 51.4097717070348 11.2693298053334, 51.3782134946566 11.2440412160001, 51.3308353514949 11.2187526266667, 51.2596762452943 11.1555311533334, 51.1963310905783 11.1049539746667, 51.1328987236114 11.054376796, 51.0932091880119 11.0037996173334, 51.0693791021764 10.978511028, 51.053485558395 10.9532224386667, 51.0375865579418 10.9152895546667, 51.0216821001682 10.8773566706667, 51.0137278245838 10.8267794920001, 51.0137278245838 10.8014909026667, 51.0137278245838 10.750913724, 50.9978151796162 10.6876922506667, 50.9898568100717 10.6371150720001, 50.9739359764586 10.5865378933334, 50.9500444885243 10.4600949466667, 50.9420779288883 10.4221620626667, 50.9181700578872 10.3589405893333, 50.91019803659 10.3210077053333, 50.9022246496782 10.2324976426666, 50.9022246496782 10.1692761693334, 50.9022246496782 10.1313432853334, 50.9022246496782 10.068121812, 50.9022246496782 10.0175446333334, 50.9022246496782 9.97961174933329, 50.9181700578872 9.916390276, 50.9261407136496 9.87845739200003, 50.9420779288883 9.84052450800006, 50.9420779288883 9.81523591866664, 50.9500444885243 9.80259162399999, 50.9500444885243 9.78994732933333, 50.9580096829447 9.78994732933333, 50.9580096829447 9.77730303466667, 50.9659735122294 9.77730303466667, 50.9739359764586 9.77730303466667, 50.9818970757127 9.77730303466667))"
For some reason the Polygon Object can not be created.
Is this the wrong way to create Polygon Objects from a list of CLLocationCoordinate2D?
What I am doing wrong? I would really appreciate if you guys can help me with that.
Thanks in advance.
The text was updated successfully, but these errors were encountered: