arthur-e / Wicket

A modest library for moving between Well-Known Text (WKT) and various framework geometries
https://arthur-e.github.io/Wicket/
Other
586 stars 226 forks source link

CircularString support #117

Open c-martinez opened 6 years ago

c-martinez commented 6 years ago

As far as I can see, circularstring objects are not yet supported. Are there any plans to support this and other curve types?

arthur-e commented 6 years ago

I have no plans to add this feature but welcome any pull requests that include it.

ffflabs commented 6 years ago

Circular strings are not supported on GeoJSON spec. Therefore, any implementation would require to transform such curves to an approximated linear geometry of an arbitrary presicion (see the implementation for google.maps.Circle)

https://github.com/arthur-e/Wicket/blob/ab38c17299596da59d9306dba192cbd7d398d5d5/wicket-gmap3.js#L415-L444

it would be overkill to implement this processing in the frontend, as the conversion from circularstrings can be already done in the backend. For example in PostGIS:

SELECT ST_AsText(ST_CurveToLine(ST_GeomFromText('CIRCULARSTRING(-67 -40,-73 -40,-67 -40)')))