[gdal-dev] Adding "Constant width" to LWPOLYLINE objects for DXF driver

Even Rouault even.rouault at spatialys.com
Wed Jun 28 06:02:56 PDT 2017


On mercredi 28 juin 2017 15:40:50 CEST Nikolai Bezdna wrote:
> Even,
> 
> RawCodeValues field seems ok to me.
> 
> 1. Should it be of JSON type or a plain string?

Good question

I'd hava said a plain string, unless we anticipate that comma might be a valid value. But JSon might also
make sense. Actually we could extend the OGRFieldSubType enumeration to have a
OFSTJSon value that would apply to the OFTString type.

(The closest thing I can think of is in the OSM driver where the other_fields field content,
which is also a dictionary, is exposed as a serialiezd Postgres HSTORE column. But
really OSM -> PG ingestion is a common use case, and it made sense to do that that way. And
at that time JSONB didn't exist as a PG type, otherwise we might have used it instead of HSTORE. And I don't
think this would make sense to reuse HSTORE for the DXF driver.)

> 
> 2. Where in the code should I add this field it to use it later in DXF
> driver? 

In https://github.com/OSGeo/gdal/blob/trunk/gdal/ogr/ogrsf_frmts/dxf/ogrdxfdatasource.cpp#L630

> 
> Sorry, not yet familiar enough with gdal codebase. Examining docs now.
> 
> Nick
> 
> > On mardi 27 juin 2017 10:01:11 CEST Nikolai Bezdna wrote:
> >> Hello,
> >> 
> >> I’d like to add a parser for Constant width property to LWPOLYLINE
> >> objects
> >> for DXF driver. The property has no.43 according to the autodesk DXF
> >> format
> >> specification:
> >> https://www.autodesk.com/techpubs/autocad/acad2000/dxf/lwpolyline_dxf_06.
> >> ht
> >> m
> >> <https://www.autodesk.com/techpubs/autocad/acad2000/dxf/lwpolyline_dxf_06
> >> .h
> >> tm>
> >> 
> >> My initial idea was to add it as a pen width (“w”) to an OGR style
> >> string,
> >> but that property is already taken by LineWeight DXF property. I’m ok
> >> with
> >> putting Constant width to the style string when LineWeight = 0 (since my
> >> data contains either Lineweight or Constant width) but that’s not a
> >> generic
> >> solution. So what is the suitable place to put this property to?
> > 
> > Nick,
> > 
> > I'm wondering if we couldn't add in the layer definition a new OGR
> > attribute RawCodeValues whose content would be
> > "code=value[,code=value]*". Only for non repeated attributes (ie not for
> > the vertices of a line), and probably only for the ones that are not
> > already handled by OGR. Not particularly user friendly admitedly, but
> > this would at least be generic for advanced uses.
> > Could potentially be used on the writing side if a user needs to add a
> > specific DXF property.
> > 
> > Even


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170628/1306c354/attachment.html>


More information about the gdal-dev mailing list