[postgis-devel] WKT format of MULTIPOINT

Paul Ramsey pramsey at cleverelephant.ca
Wed Jan 15 08:42:13 PST 2020


There’s really no way we’re going to change what we emit, we’ve got too much downstream to do that.
We already *accept* the two-paren input form. Internally the txt generator has a bunch of flags to control whether to add dimensionality tokens, srid numbers, etc, and could easily enough add another flag to add parens on multipoints, but exposing that functionality gets ugly, since it’s such a tiny nit, it seems crazy to have a whole extra function just for it.

P

> On Jan 15, 2020, at 8:37 AM, Andy Teucher <andy.teucher at gmail.com> wrote:
> 
> Thanks very much for this Martin, and thanks for pointing out that it’s likely geoserver that’s the culprit here…
> 
> Is there appetite  to consider this change? If backward compatibility is desirable, I suppose another option could be a new argument in st_astext(), where the default uses the current behaviour? I could open a ticket if you’d like…
> 
> Thanks again,
> Andy
> 
> 
> Date: Sat, 28 Dec 2019 15:28:30 -0800
> From: Martin Davis <mtnclimb at gmail.com>
> To: PostGIS Development Discussion <postgis-devel at lists.osgeo.org>
> Subject: Re: [postgis-devel] WKT format of MULTIPOINT
> Message-ID:
> 	<CAK2ens1wHtav8ZWJGaOYrTWWZJZjS7h0DRGP2RTghY=Rbgd3ww at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> This doesn't change the question, but I'm 99% sure that it is Geoserver
> which is refusing to parse the paren-free MultiPoint, not Oracle.
> 
> This *may* affect the discussion, however, since that's at least two major
> products which do not accept the "incorrect" syntax.
> 
> On Wed, Dec 18, 2019, 12:23 PM Andy Teucher <andy.teucher at gmail.com> wrote:
> 
>> The WKT representation of MULTIPOINT features can take two different
>> forms, both of which are accepted (almost) universally. PostGIS (st_astext)
>> implements the format without parentheses around individual point
>> coordinate pairs:
>> 
>> MULTIPOINT (0 0, 1 1)
>> vs
>> MULTIPOINT ((0 0), (1 1))
>> 
>> I know this has been discussed in the past (
>> https://lists.osgeo.org/pipermail/postgis-devel/2013-December/023990.html
>> and https://trac.osgeo.org/postgis/ticket/2558) however I’ve come across
>> a situation where it is making a difference.
>> 
>> I have been using a geoserver wfs service to obtain spatial data, and
>> supplying multipoint features to a geometry predicate (e.g., INTERSECTS)
>> without nested parenthesis fails:
>> 
>> $ wget -O "a.json" "
>> https://openmaps.gov.bc.ca/geo/pub/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&outputFormat=application/json&typeNames=WHSE_BASEMAPPING.GBA_LOCAL_REG_GREENSPACES_SP&SRSNAME=EPSG:3005&CQL_FILTER=INTERSECTS(SHAPE,
>> MULTIPOINT (1236285 463726.8, 1228264 463547.4))"
>> 
>> --2019-12-18 12:08:52--
>> https://openmaps.gov.bc.ca/geo/pub/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&outputFormat=application/json&typeNames=WHSE_BASEMAPPING.GBA_LOCAL_REG_GREENSPACES_SP&SRSNAME=EPSG:3005&CQL_FILTER=INTERSECTS(SHAPE,%20MULTIPOINT%20(1236285%20463726.8,%201228264%20463547.4))
>> Resolving openmaps.gov.bc.ca (openmaps.gov.bc.ca)... 142.34.140.41
>> Connecting to openmaps.gov.bc.ca (openmaps.gov.bc.ca)|142.34.140.41|:443...
>> connected.
>> HTTP request sent, awaiting response... 400
>> 2019-12-18 12:08:52 ERROR 400: (no description).
>> 
>> But it works when inner parentheses are present:
>> 
>> $ wget -O "a.json" "
>> https://openmaps.gov.bc.ca/geo/pub/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&outputFormat=application/json&typeNames=WHSE_BASEMAPPING.GBA_LOCAL_REG_GREENSPACES_SP&SRSNAME=EPSG:3005&CQL_FILTER=INTERSECTS(SHAPE,
>> MULTIPOINT ((1236285 463726.8), (1228264 463547.4)))"
>> 
>> --2019-12-18 12:10:20--
>> https://openmaps.gov.bc.ca/geo/pub/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&outputFormat=application/json&typeNames=WHSE_BASEMAPPING.GBA_LOCAL_REG_GREENSPACES_SP&SRSNAME=EPSG:3005&CQL_FILTER=INTERSECTS(SHAPE,%20MULTIPOINT%20((1236285%20463726.8),%20(1228264%20463547.4)))
>> Resolving openmaps.gov.bc.ca (openmaps.gov.bc.ca)... 142.34.140.41
>> Connecting to openmaps.gov.bc.ca (openmaps.gov.bc.ca)|142.34.140.41|:443...
>> connected.
>> HTTP request sent, awaiting response... 200
>> Length: unspecified [application/json]
>> Saving to: ‘a.json’
>> 
>> a.json                  [ <=>                ]   3.59K  --.-KB/s    in 0s
>> 2019-12-18 12:10:20 (35.4 MB/s) - ‘a.json’ saved [3678]
>> 
>> I believe the database behind the geoserver is Oracle, which I have seen
>> elsewhere only accepts the variety of MULTIPOINT with nested parentheses (
>> https://viswaug.wordpress.com/2011/02/13/well-known-text-wkt-representation-for-multipoint/
>> ).
>> 
>> What is the possibility of PostGIS being able to output the nested-parens
>> version of MULTIPOINT wkt?
>> 
>> Thanks for your time!
>> Andy Teucher
>> 
>> 
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-devel
> 
> 
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel



More information about the postgis-devel mailing list