<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I’ve pushed up some work to do this</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">https://github.com/pramsey/gdal/tree/isowkb</div> <div id="bloop_sign_1386964682728801024" class="bloop_sign"><div><br></div><div>I had to change *two* method signatures, which I don’t really like, both exportToWkb and getGeometryType needed a variant parameter added. The problem is that getGeometryType returns the full WKB type, with dimensionality encoded, which makes it somewhat duplicative of getCoordinateDimension. In an ideal world, getGeometryType would only return the type number, and dimensionally information would be inferred from getCoordinateDimension.</div><div><br></div><div>Then only the exportToWkb signature would need a variant parameter.</div><div><br></div><div>importFromWkb also was changed to ingest the ISO variant if that’s what it’s fed. No changes to signature required there.</div><div><br></div><div>P.</div><div><br></div><span style="font-family:helvetica,arial;font-size:13px"></span>-- <br>Paul Ramsey<br>http://cleverelephant.ca<div>http://postgis.net</div></div> <br><p style="color:#A0A0A8;">On December 12, 2013 at 2:58:05 PM, Even Rouault (<a href="mailto://even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div>Le jeudi 12 décembre 2013 23:39:25, Paul Ramsey a écrit :
<br>> I’ve been looking over the code, and I think I can make importFromWkb
<br>> consume ISO inputs with relatively minor changes. (during the geometry
<br>> type determination in the concrete types, it looks easy enough to add a
<br>> little logic to deal with ISO type numbers) For exportToWkb, I’m wondering
<br>> if maybe an optional parameter (wkbVariant?) that defaults to
<br>> wkbVariantOGC would be sufficient?
<br>
<br>Sounds good to me. Is "wkbVariantOGC" the variant currently implemented ? Is  
<br>our 3D support really compliant with an OGC standard ?
<br>
<br>>  
<br>> It also seems the wkb reader/writer have little handling for empty geometry
<br>> types. I’d like to add some in, if that’s OK.
<br>
<br>Are you sure about that ?
<br>
<br>See :
<br>
<br>>>> from osgeo import ogr
<br>>>> ogr.CreateGeometryFromWkb(g.ExportToWkb()).ExportToWkt()
<br>'LINESTRING EMPTY'
<br>>>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('LINESTRING  
<br>EMPTY').ExportToWkb()).ExportToWkt()
<br>'LINESTRING EMPTY'
<br>>>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('LINESTRING  
<br>EMPTY').ExportToWkb()).ExportToWkt()
<br>'LINESTRING EMPTY'
<br>>>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('POLYGON  
<br>EMPTY').ExportToWkb()).ExportToWkt()
<br>'POLYGON EMPTY'
<br>>>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('MULTILINESTRING  
<br>EMPTY').ExportToWkb()).ExportToWkt()
<br>'MULTILINESTRING EMPTY'
<br>>>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('MULTIPOLYGON  
<br>EMPTY').ExportToWkb()).ExportToWkt()
<br>'MULTIPOLYGON EMPTY'
<br>>>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('GEOMETRYCOLLECTION  
<br>EMPTY').ExportToWkb()).ExportToWkt()
<br>'GEOMETRYCOLLECTION EMPTY'
<br>
<br>The only exception is POINT EMPTY due to the lack of wkb representation for it  
<br>:
<br>>>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('POINT  
<br>EMPTY').ExportToWkb()).ExportToWkt()
<br>'POINT (0 0)'
<br>
<br>
<br>>  
<br>> Fortunately the only substantial difference for ISO WKB is the type number.
<br>>  
<br>> I’m starting an isowkb branch on my git repo to hold this piece of work, I
<br>> don’t think it’ll be very big.
<br>>  
<br>> Then I’ll start asking about ‘m’ dimensions :)
<br>
<br>That's a fresh new land to explore...
<br>
<br>>  
<br>> P.
<br>>  
<br>> --  
<br>> Paul Ramsey
<br>> http://cleverelephant.ca
<br>> http://postgis.net
<br>>  
<br>> On December 12, 2013 at 2:33:41 PM, Even Rouault
<br>> (even.rouault@mines-paris.org) wrote:
<br>>  
<br>> Le jeudi 12 décembre 2013 21:36:42, Paul Ramsey a écrit :
<br>> > Hey all,
<br>> > Is there already a facility for writing out ISO-standard WKB in GDAL? The
<br>> > biggest difference is the wkbGeometryType number for the case of 3d
<br>> > features. OGR currently uses the old extended SFSQL adopted by PostGIS.
<br>> > ISO (naturally) did their own thing. As far as I can see, there’s no
<br>> > support there now, or is there? P.
<br>>  
<br>> Hi Paul,
<br>>  
<br>> no, there's no support for ISO WKB yet. We still stick to
<br>> http://home.gdal.org/projects/opengis/twohalfdsf.html
<br>>  
<br>> I can imagine we could have exportToISOWkb() method in OGRGeometry*. Or we
<br>> could add an extra boolean argument bISOWkb to the existing exportToWkb().
<br>> Not sure about WkbSize() : does the size of ISO WKB blobs differ from the
<br>> unofficial WKB ?
<br>>  
<br>> Even
<br>>  
<br>> --
<br>> Geospatial professional services
<br>> http://even.rouault.free.fr/services.html
<br>
<br>--  
<br>Geospatial professional services
<br>http://even.rouault.free.fr/services.html
<br></div></div></span></blockquote></body></html>