[gdal-dev] ogr2ogr JSON -> Shapefile Failing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] ogr2ogr JSON -> Shapefile Failing

mcechini

All,

    Once upon a time (GDAL 1.x) I was able to convert the following JSON to Shapefile without errors.  However with GDAL 2.x I am not.  Any assistance you can provide is welcome.  I’m running a simple ` ogr2ogr -f "ESRI Shapefile" -preserve_fid <out> <in>` command.

 

{

  "crs":

  {

    "type": "name",

    "properties":

    {

      "name": "EPSG3413"

    }

  },

  "type": "FeatureCollection",

  "features": [

  {

    "geometry":

    {

      "type": "Point",

      "coordinates": [324117.76729052397, 844135.46348421532]

    },

    "type": "Feature",

    "id"  : 230,

    "properties":

    {

      "direction" : "T",

      "ident"     : 230,

      "id"        : 230,

      "day_offset": 0,

      "label"     : "00:44",

      "day_night" : "D",

      "time"      : "00:45",

      "datetime"  : "2017-01-01T00:45:00 UTC"

    }

  }]

}

 

 

These are the errors I am seeing:

 

ERROR 6: Can't create fields of type Time on shapefile layers.

ERROR 6: Can't create fields of type Time on shapefile layers.

Warning 1: Feature id not preserved

 

Thanks,

Matt

.................................................................

Matthew Cechini

Contractor, Science Systems and Applications, Inc.

NASA GIBS Systems/Software Engineer

410.205.6272


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ogr2ogr JSON -> Shapefile Failing

Even Rouault-2
On mercredi 18 avril 2018 20:00:40 CEST Cechini, Matthew F. (GSFC-423.0)
[Science Systems & Applications, Inc.] wrote:
> All,
>     Once upon a time (GDAL 1.x) I was able to convert the following JSON to
> Shapefile without errors.  However with GDAL 2.x I am not.  Any assistance
> you can provide is welcome.  I’m running a simple ` ogr2ogr -f "ESRI
> Shapefile" -preserve_fid <out> <in>` command.

Add " -fieldTypeToString Time" to force the conversion of time fields as
strings.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ogr2ogr JSON -> Shapefile Failing

mcechini
Great, that worked.  Now to figure out how to solve the "Warning 1: Feature id not preserved" error.  I suspect if I dig long enough in google I'll find the key, but am hoping someone will see this and make my life easy.

Matt
.................................................................
Matthew Cechini
Contractor, Science Systems and Applications, Inc.
NASA GIBS Systems/Software Engineer
410.205.6272
On 4/18/18, 4:34 PM, "Even Rouault" <[hidden email]> wrote:

    On mercredi 18 avril 2018 20:00:40 CEST Cechini, Matthew F. (GSFC-423.0)
    [Science Systems & Applications, Inc.] wrote:
    > All,
    >     Once upon a time (GDAL 1.x) I was able to convert the following JSON to
    > Shapefile without errors.  However with GDAL 2.x I am not.  Any assistance
    > you can provide is welcome.  I’m running a simple ` ogr2ogr -f "ESRI
    > Shapefile" -preserve_fid <out> <in>` command.
   
    Add " -fieldTypeToString Time" to force the conversion of time fields as
    strings.
   
    Even
   
    --
    Spatialys - Geospatial professional services
    http://www.spatialys.com
   

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ogr2ogr JSON -> Shapefile Failing

Even Rouault-2
On mercredi 18 avril 2018 20:41:05 CEST Cechini, Matthew F. (GSFC-423.0)
[Science Systems & Applications, Inc.] wrote:
> Great, that worked.  Now to figure out how to solve the "Warning 1: Feature
> id not preserved" error.  I suspect if I dig long enough in google I'll
> find the key, but am hoping someone will see this and make my life easy.

Feature id preservation is not supported by the shapefile driver.

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev