[postgis-users] CIRCULARSTRING Syntax
newjim
joleary.public at gmail.com
Sun Aug 18 17:26:50 PDT 2013
The documentation for CIRCULARSTRING says:
/"CIRCULARSTRING(0 0, 4 0, 4 4, 0 4, 0 0)
The CIRCULARSTRING is the basic curve type, similar to a LINESTRING in the
linear world. A single segment required three points, the start and end
points (first and third) and any other point on the arc. The exception to
this is for a closed circle, where the start and end points are the same. In
this case the second point MUST be the center of the arc, ie the opposite
side of the circle. To chain arcs together, the last point of the previous
arc becomes the first point of the next arc, just like in LINESTRING. This
means that a valid circular string must have an odd number of points greated
than 1."/
I am trying to make a closed circle. I have my west lat/lng, north lat/lng,
east lat/lng and south lat/lng but I'm not able to use any combination that
produces a closed circle such that a call ST_WITHIN will select features.
For example, my PHP code:
ST_GeomFromText('SRID=4326;CIRCULARSTRING($westLng $westLat,$northLng
$northLat, $eastLng $eastLat, $southLng $southLat, $westLng $westLat)')
...produces this query:
Select *
FROM nepp_seminar
WHERE ST_WITHIN(geometry,ST_GeomFromText('SRID=4326;CIRCULARSTRING(-123.1167
49.2650,-123.1098 49.2695, -123.1029 49.2650, -123.1098 49.2605, -123.1167
49.2650)'))
...but generates this message:
Exception in LWGEOM2GEOS: curved geometry not supported
I'm especially puzzled by the line that says that the "second point must be
the center of the arc". The example above does not seem like four points on
a circle, but rather four points on a rectangle.
Calls to ST_WITHIN using POLYGON work as expected.
My web host is using:
PostgreSQL 8.4.4
This query...
select PostGIS_full_version()
...produces
POSTGIS="1.4.0" GEOS="3.1.1-CAPI-1.6.0" PROJ="Rel. 4.6.1, 21 August 2008"
USE_STATS
This query...
SELECT PostGIS_version()
...produces
1.4 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
Thanks for your help
--
View this message in context: http://postgis.17.x6.nabble.com/CIRCULARSTRING-Syntax-tp5004021.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130818/7ab49a2a/attachment.html>
More information about the postgis-users
mailing list