[OpenLayers-Trac] Re: [OpenLayers] #2670: wkt multipoint from JTS

OpenLayers trac-20090302 at openlayers.org
Wed Jul 6 10:40:28 EDT 2011


#2670: wkt multipoint from JTS
-------------------------+--------------------------------------------------
  Reporter:  halset      |       Owner:  tschaub     
      Type:  bug         |      Status:  reopened    
  Priority:  minor       |   Milestone:  2.11 Release
 Component:  Format.WKT  |     Version:  SVN         
Resolution:              |    Keywords:              
     State:  Review      |  
-------------------------+--------------------------------------------------

Comment(by slinkp):

 fwiw, geodjango outputs the non-parens formatting, as do both underlying
 libraries (GEOS and GDAL/OGR):

 {{{
 >>> from django.contrib.gis.gdal import OGRGeometry
 >>> hex_wkb =
 '010400000006000000010100000049AE47E1A7C451C0D3F1ABD8142F4540010100000064AE47610AC451C0873C19C79E2D4540010100000064AE47610AC451C0884F1F8A872E4540010100000007AE47A16FC451C0175C213A7F2E4540010100000040AE476164C451C035D1D069342E4540010100000026AE47E14DC451C0B31E01CAA82E4540'
 >>> ogrgeom = OGRGeometry(hex_wkb)
 >>> ogrgeom.wkt
 'MULTIPOINT (-71.072746582031996 42.367823680836999,-71.063133544923005
 42.356408011744001,-71.063133544923005
 42.363511338508999,-71.069313354491996
 42.363257662095002,-71.068626708984993
 42.360974528275996,-71.067253417968999 42.364526033922992)'
 >>> from django.contrib.gis.geos import GEOSGeometry
 >>> geosgeom = GEOSGeometry(hex_wkb)
 >>> geosgeom.wkt
 'MULTIPOINT (-71.0727465820319964 42.3678236808369988,
 -71.0631335449230050 42.3564080117440014, -71.0631335449230050
 42.3635113385089994, -71.0693133544919959 42.3632576620950019,
 -71.0686267089849935 42.3609745282759960, -71.0672534179689990
 42.3645260339229921)'

 }}}

 As far as I can tell, both GEOSGeometry and OGRGeometry accept either
 variant as input without complaint.

 The upshot is that in GeoDjango you can't currently use openlayers to edit
 existing multipoint geometries; when you load the edit screen, GeoDjango
 outputs the non-paren format and OL displays only one point.

 I have not observed any problems with multipolygon or multilinestring.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/2670#comment:11>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list