[GRASS-user] OpenFileGDB input error

   I must have missed something while trying to input an OpenFileGDB map and
the error message isn't telling me what I missed.

   Using the GUI I ran v.in.ogr, specifying the directory in which the file
is found (the location uses the final EPSG reported when 'ogrinfo -al -so'
was run with output directed to a file), the format, and clicked the single
layer in the Input tab. This is the displayed error message:

(Sun Sep 24 11:59:03 2017) v.in.ogr input=/home/rshepard/data/grassdata/wash-state-data/farmland/2016WSDACropDistribution.gdb layer=WSDACrop_2016
Check if OGR layer <WSDACrop_2016> contains polygons...
Importing 198132 features
Importing 198132 features (OGR layer <WSDACrop_2016>)...
ERROR: Unknown geometry type
(Sun Sep 24 11:59:59 2017) Command finished (55 sec)

   Isn't the geometry type specified in these files? Advice needed.

TIA,

Rich

On Sun, 24 Sep 2017, Rich Shepard wrote:

Using the GUI I ran v.in.ogr, specifying the directory in which the file
is found (the location uses the final EPSG reported when 'ogrinfo -al -so'
was run with output directed to a file), the format, and clicked the single
layer in the Input tab. This is the displayed error message:

(Sun Sep 24 11:59:03 2017) v.in.ogr input=/home/rshepard/data/grassdata/wash-state-data/farmland/2016WSDACropDistribution.gdb layer=WSDACrop_2016
Check if OGR layer <WSDACrop_2016> contains polygons...
Importing 198132 features
Importing 198132 features (OGR layer <WSDACrop_2016>)...
ERROR: Unknown geometry type
(Sun Sep 24 11:59:59 2017) Command finished (55 sec)

   More information I should have included. From the ogrinfo metadata:

Layer name: WSDACrop_2016
Geometry: Multi Polygon
Feature Count: 198132

   What does GRASS call 'Multi Polygon'?

Rich

Le Sun, 24 Sep 2017 13:18:34 -0700 (PDT),
Rich Shepard <rshepard@appl-ecosys.com> a écrit :

On Sun, 24 Sep 2017, Rich Shepard wrote:

> Using the GUI I ran v.in.ogr, specifying the directory in which
> the file is found (the location uses the final EPSG reported when
> 'ogrinfo -al -so' was run with output directed to a file), the
> format, and clicked the single layer in the Input tab. This is the
> displayed error message:
>
> (Sun Sep 24 11:59:03 2017) v.in.ogr
> input=/home/rshepard/data/grassdata/wash-state-data/farmland/2016WSDACropDistribution.gdb
> layer=WSDACrop_2016
> Check if OGR layer <WSDACrop_2016> contains polygons...
> Importing 198132 features
> Importing 198132 features (OGR layer <WSDACrop_2016>)...
> ERROR: Unknown geometry type
> (Sun Sep 24 11:59:59 2017) Command finished (55 sec)

   More information I should have included. From the ogrinfo metadata:

Layer name: WSDACrop_2016
Geometry: Multi Polygon
Feature Count: 198132

   What does GRASS call 'Multi Polygon'?

I can't answer that, but what happens when you run ogr2ogr on the
layer to transform it into a GeoPackage or a Shapefile ?

Moritz

On Sun, Sep 24, 2017 at 10:18 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Sun, 24 Sep 2017, Rich Shepard wrote:

Using the GUI I ran v.in.ogr, specifying the directory in which the file
is found (the location uses the final EPSG reported when ‘ogrinfo -al -so’
was run with output directed to a file), the format, and clicked the single
layer in the Input tab. This is the displayed error message:

(Sun Sep 24 11:59:03 2017) v.in.ogr input=/home/rshepard/data/grassdata/wash-state-data/farmland/2016WSDACropDistribution.gdb layer=WSDACrop_2016
Check if OGR layer <WSDACrop_2016> contains polygons…
Importing 198132 features
Importing 198132 features (OGR layer <WSDACrop_2016>)…
ERROR: Unknown geometry type
(Sun Sep 24 11:59:59 2017) Command finished (55 sec)

More information I should have included. From the ogrinfo metadata:

Layer name: WSDACrop_2016
Geometry: Multi Polygon
Feature Count: 198132

What does GRASS call ‘Multi Polygon’?

Each polygon of a multi-polygon is imported separately, later on polygons are converted to GRASS areas.

Regarding the error message, GRASS recognizes the OGR geometry types point, linestring, polygon, geometry collection, multi-point, multi-linestring, multi-polygon. Other OGR geometry types like curves and surfaces are not supported.

Markus M

Rich


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

On Mon, 25 Sep 2017, Markus Metz wrote:

  More information I should have included. From the ogrinfo metadata:
Geometry: Multi Polygon

Each polygon of a multi-polygon is imported separately, later on polygons
are converted to GRASS areas.

Markus,

   Another ofgdb file with multiple layers (major streams, minor streams, and
lakes) imported only the first layer despite my selecting all three in the
input box.

Regarding the error message, GRASS recognizes the OGR geometry types ... multi-polygon

   Then the source of the input error might be a corrupted souce file? I can
download it again later today.

Thanks,

Rich

[Please keep discussions on the list.]

On 25/09/17 16:19, Rich Shepard wrote:

On Mon, 25 Sep 2017, Moritz Lennert wrote:

I can't answer that, but what happens when you run ogr2ogr on the layer to
transform it into a GeoPackage or a Shapefile?

Moritz,

    I've not before used ogr2ogr and reading the man page leaves me uncertain
which options I should use other than the destination and source formats.

    This is the summary of the source .gdb:

Layer name: WSDACrop_2016
Geometry: Multi Polygon
Feature Count: 198132
Extent: (194040.798600, 26290.144100) - (776078.287500, 411036.825500)
Layer SRS WKT:
PROJCS["NAD83(HARN) / Washington South",
      GEOGCS["NAD83(HARN)",
          DATUM["NAD83_High_Accuracy_Reference_Network",
              SPHEROID["GRS 1980",6378137,298.257222101,
                  AUTHORITY["EPSG","7019"]],
              TOWGS84[0,0,0,0,0,0,0],
              AUTHORITY["EPSG","6152"]],
          PRIMEM["Greenwich",0,
              AUTHORITY["EPSG","8901"]],
          UNIT["degree",0.0174532925199433,
              AUTHORITY["EPSG","9122"]],
          AUTHORITY["EPSG","4152"]],
      PROJECTION["Lambert_Conformal_Conic_2SP"],
      PARAMETER["standard_parallel_1",47.33333333333334],
      PARAMETER["standard_parallel_2",45.83333333333334],
      PARAMETER["latitude_of_origin",45.33333333333334],
      PARAMETER["central_meridian",-120.5],
      PARAMETER["false_easting",500000],
      PARAMETER["false_northing",0],
      UNIT["metre",1,
          AUTHORITY["EPSG","9001"]],
      AXIS["X",EAST],
      AXIS["Y",NORTH],
      AUTHORITY["EPSG","2856"]]
FID Column = OBJECTID
Geometry Column = SHAPE
CropGroup: String (254.0)
Acres: Integer (0.0)
Irrigation: String (254.0)
InitialSurveyDate: DateTime (0.0)
LastSurveyDate: DateTime (0.0)
DataSource: String (254.0)
Notes: String (254.0)
TRS: String (15.0)
County: String (254.0)
RotCropType: String (254.0)
ExactAcres: Real (0.0)
Organic: String (3.0)
SHAPE_Length: Real (0.0)
SHAPE_Area: Real (0.0)

Layer name: CropData
Geometry: None
Feature Count: 198132
Layer SRS WKT:
(unknown)
FID Column = OBJECTID
CropGroup: String (254.0)
CropType: String (254.0)
Acres: Integer (0.0)
Irrigation: String (254.0)
InitialSurveyDate: DateTime (0.0)
LastSurveyDate: DateTime (0.0)
DataSource: String (254.0)
Notes: String (254.0)
TRS: String (15.0)
County: String (254.0)
RotCropType: String (254.0)
ExactAcres: Real (0.0)
Organic: String (3.0)
SHAPE_Length: Real (0.0)
SHAPE_Area: Real (0.0)

    The error after the ogr first pass is "ERROR: Unknown geometry type"

This is with what command line ?

    Do I run ogr2ogr with no options specifying the same file name with
extension .shp for the destination and with the extension .gdb for the
source?

You can use whatever filename you want, but this should work, yes.

Moritz

On Mon, Sep 25, 2017 at 4:23 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Mon, 25 Sep 2017, Markus Metz wrote:

More information I should have included. From the ogrinfo metadata:
Geometry: Multi Polygon

Each polygon of a multi-polygon is imported separately, later on polygons
are converted to GRASS areas.

Markus,

Another ofgdb file with multiple layers (major streams, minor streams, and
lakes) imported only the first layer despite my selecting all three in the
input box.

Regarding the error message, GRASS recognizes the OGR geometry types … multi-polygon

Then the source of the input error might be a corrupted souce file? I can
download it again later today.

Can you provide (off-list if necessary) a link to the file? Then others can test as well.

Markus M

On Mon, 25 Sep 2017, Moritz Lennert wrote:

[Please keep discussions on the list.]

Moritz,

   That was my intent. When there are multiple addresses I sometimes miss
which one remains.

This is with what command line ?

   No, the GUI. Will use the command line now.

You can use whatever filename you want, but this should work, yes.

   OK.

Thanks,

Rich

On Mon, 25 Sep 2017, Moritz Lennert wrote:

This is with what command line ?

Moritz,

~/data/grassdata/wash-state-data/farmland > v.in.ogr
in=2016WSDACropDistribution.gdb/ layer=WSDACrop_2016,CropData --overwrite
Segmentation fault

   I'll download a new copy later today and try again.

Rich

On Mon, 25 Sep 2017, Markus Metz wrote:

Can you provide (off-list if necessary) a link to the file? Then others
can test as well.

Markus,

   The URL to the agency's digital data is
<http://www.ecy.wa.gov/services/gis/data/data.htm&gt;\. Scroll down to "National
Hydrography Dataset (NHD) 24k: Major Areas, Streams, & Waterbodies Major NHD
water features for cartographic use (3 layers)" and you can download
NHDmajor.gdb.zip (~36M).

   When I view the imported map I see only the Major Streams layer to
display.

Thanks,

Rich

On Mon, Sep 25, 2017 at 5:31 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Mon, 25 Sep 2017, Markus Metz wrote:

Can you provide (off-list if necessary) a link to the file? Then others
can test as well.

Markus,

The URL to the agency’s digital data is
<http://www.ecy.wa.gov/services/gis/data/data.htm>. Scroll down to “National
Hydrography Dataset (NHD) 24k: Major Areas, Streams, & Waterbodies Major NHD
water features for cartographic use (3 layers)” and you can download
NHDmajor.gdb.zip (~36M).

Apparently you confused threads. A link is needed to 2016WSDACropDistribution.gdb.zip.

Markus M

When I view the imported map I see only the Major Streams layer to
display.

Thanks,

Rich


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

On Mon, Sep 25, 2017 at 10:15 AM, Markus Metz <markus.metz.giswork@gmail.com> wrote:

On Sun, Sep 24, 2017 at 10:18 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Sun, 24 Sep 2017, Rich Shepard wrote:

Using the GUI I ran v.in.ogr, specifying the directory in which the file
is found (the location uses the final EPSG reported when ‘ogrinfo -al -so’
was run with output directed to a file), the format, and clicked the single
layer in the Input tab. This is the displayed error message:

(Sun Sep 24 11:59:03 2017) v.in.ogr input=/home/rshepard/data/grassdata/wash-state-data/farmland/2016WSDACropDistribution.gdb layer=WSDACrop_2016
Check if OGR layer <WSDACrop_2016> contains polygons…
Importing 198132 features
Importing 198132 features (OGR layer <WSDACrop_2016>)…
ERROR: Unknown geometry type
(Sun Sep 24 11:59:59 2017) Command finished (55 sec)

More information I should have included. From the ogrinfo metadata:

Layer name: WSDACrop_2016
Geometry: Multi Polygon
Feature Count: 198132

What does GRASS call ‘Multi Polygon’?

Each polygon of a multi-polygon is imported separately, later on polygons are converted to GRASS areas.

Regarding the error message, GRASS recognizes the OGR geometry types point, linestring, polygon, geometry collection, multi-point, multi-linestring, multi-polygon. Other OGR geometry types like curves and surfaces are not supported.

A multi-surface has sneaked into the layer with multi-polygons, that’s causing the error in v.in.ogr.

We could change that error into a warning, skipping OGR geometries of unsupported type.

Markus M

On Mon, 25 Sep 2017, Markus Metz wrote:

Apparently you confused threads. A link is needed to
2016WSDACropDistribution.gdb.zip.

Markus,

   There are import issues with 2 OpenFileGDB datasets. The hydrography one
whose URL I provided should have 3 layers, but only the major streams layer
was imported using the GUI (and I checked all three on the input tab).

   The cropland file keeps segfaulting. And, it is supposed to have 2 layers
(areas and the crops in each), but only the first is shown as available for
import. Here's the URL to the above file:
<https://agr.wa.gov/PestFert/natresources/AgLandUse.aspx&gt;\. On the right side
column the file to download is "2016 Ag Land Use GIS Data".

Rich

On Mon, 25 Sep 2017, Markus Metz wrote:

A multi-surface has sneaked into the layer with multi-polygons, that's
causing the error in v.in.ogr.

   Huh! In my naivity I would assume a surface is 3D and a polygon is 2D.
What I read suggests there are two layers; perhaps the surfaces are crop
type and the polygons are farm boundaries?

We could change that error into a warning, skipping OGR geometries of
unsupported type.

   As long as the crop categories and specifics are in the sqlite database
associated with each polygon the necessary information is available.

Thanks,

Rich

On Mon, Sep 25, 2017 at 6:07 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Mon, 25 Sep 2017, Markus Metz wrote:

A multi-surface has sneaked into the layer with multi-polygons, that’s
causing the error in v.in.ogr.

Huh! In my naivity I would assume a surface is 3D and a polygon is 2D.
What I read suggests there are two layers; perhaps the surfaces are crop
type and the polygons are farm boundaries?

these multi-surfaces are in the layer with multi-polygons. OGR calls these geometries multi-surfaces. Investigating a bit more, I found curve-polygons within these multi-surfaces. Curve-polygons are in turn not ordinary polygons, but defined by curves, and v.in.ogr (most GIS software in general) does not support curves.

Markus M

We could change that error into a warning, skipping OGR geometries of
unsupported type.

As long as the crop categories and specifics are in the sqlite database
associated with each polygon the necessary information is available.

Thanks,

Rich


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

On lundi 25 septembre 2017 19:19:26 CEST Markus Metz wrote:

On Mon, Sep 25, 2017 at 6:07 PM, Rich Shepard rshepard@appl-ecosys.com

wrote:

On Mon, 25 Sep 2017, Markus Metz wrote:

A multi-surface has sneaked into the layer with multi-polygons, that’s

causing the error in v.in.ogr.

Huh! In my naivity I would assume a surface is 3D and a polygon is 2D.

What I read suggests there are two layers; perhaps the surfaces are crop

type and the polygons are farm boundaries?

these multi-surfaces are in the layer with multi-polygons. OGR calls these

geometries multi-surfaces.

Actually it is defined by

​OpenGIS Simple Feature Access Part 1 : Common Architecture,v 1.2.1 :

http://portal.opengeospatial.org/files/?artifact_id=25355

Investigating a bit more, I found curve-polygons

within these multi-surfaces. Curve-polygons are in turn not ordinary

polygons, but defined by curves, and v.in.ogr (most GIS software in

general) does not support curves.

The relevant GDAL RFC is

https://trac.osgeo.org/gdal/wiki/rfc49_curve_geometries

Support for curves in FileGDB is more recent.

You can force a curve geometry to its linearized version (curves are approximated with segments) with:

hGeom = OGR_G_ForceTo(hGeom, OGR_GT_GetLinear(OGR_G_GetGeometryType(hGeom)))

Even

Spatialys - Geospatial professional services

http://www.spatialys.com

On Mon, 25 Sep 2017, Markus Metz wrote:

these multi-surfaces are in the layer with multi-polygons. OGR calls these
geometries multi-surfaces. Investigating a bit more, I found
curve-polygons within these multi-surfaces. Curve-polygons are in turn not
ordinary polygons, but defined by curves, and v.in.ogr (most GIS software
in general) does not support curves.

Markus,

   Thanks for exploring the data files. Please suggest how I could extract
the useful polygons and attribute data. I know that agencies assume everyone
buys ESRI's software and they're not concerned with accommodating those of
us who do not. In the mid-1990s everyone used ESRI's export format (.e00)
and it was easy to write input filters for grass back then.

Best regards.

Rich

Greetings,

I have rasters being stored on old-fashioned spinning disks. If I could store temporary files on a solid-state drive I think the operations I am performing would be considerably faster.

I see that there is a variable for specifying what temp directory to use with vector operations, but I don’t see a way to change the temp directory for raster operations. Is it possible?

https://grass.osgeo.org/grass72/manuals/variables.html

Thanks,

Jeshua Lacock
Founder/Engineer
<3DTOPO.com>
GlassPrinted.com

On lundi 25 septembre 2017 11:04:35 CEST Rich Shepard wrote:

On Mon, 25 Sep 2017, Markus Metz wrote:

these multi-surfaces are in the layer with multi-polygons. OGR calls these

geometries multi-surfaces. Investigating a bit more, I found

curve-polygons within these multi-surfaces. Curve-polygons are in turn not

ordinary polygons, but defined by curves, and v.in.ogr (most GIS software

in general) does not support curves.

Markus,

Thanks for exploring the data files. Please suggest how I could extract

the useful polygons and attribute data. I know that agencies assume everyone

buys ESRI’s software and they’re not concerned with accommodating those of

us who do not. In the mid-1990s everyone used ESRI’s export format (.e00)

and it was easy to write input filters for grass back then.

You could for example use ogr2ogr to convert the curve geometries to linear ones with

ogr2ogr -f sqlite out.db in.gdb -nlt CONVERT_TO_LINEAR

Even

Spatialys - Geospatial professional services

http://www.spatialys.com

On Mon, Sep 25, 2017 at 8:23 PM, Even Rouault <even.rouault@spatialys.com> wrote:

On lundi 25 septembre 2017 11:04:35 CEST Rich Shepard wrote:

On Mon, 25 Sep 2017, Markus Metz wrote:

these multi-surfaces are in the layer with multi-polygons. OGR calls these

geometries multi-surfaces. Investigating a bit more, I found

curve-polygons within these multi-surfaces. Curve-polygons are in turn not

ordinary polygons, but defined by curves, and v.in.ogr (most GIS software

in general) does not support curves.

Markus,

Thanks for exploring the data files. Please suggest how I could extract

the useful polygons and attribute data. I know that agencies assume everyone

buys ESRI’s software and they’re not concerned with accommodating those of

us who do not. In the mid-1990s everyone used ESRI’s export format (.e00)

and it was easy to write input filters for grass back then.

You could for example use ogr2ogr to convert the curve geometries to linear ones with

ogr2ogr -f sqlite out.db in.gdb -nlt CONVERT_TO_LINEAR

Thanks a lot for this suggestion! How are these curves converted to linear features, i.e. how does ogr2ogr decide on reasonable conversion parameters such as distance between vertices?

Regarding the dataset in question, it would be interesting to know what kind of information is provided with these multi-surfaces, if it is the same as in the multi-polygons or something different.

A summary on the OpenFileGDB import issues:

NHDmajor.gdb is available at

ftp://www.ecy.wa.gov/gis_a/inlandWaters/NHD/NHDmajor.gdb.zip

and contains 3 layers
1: NHD_MajorStreams (3D Measured Multi Line String)
2: NHD_MajorAreas (3D Multi Polygon)
3: NHD_MajorWaterbodies (3D Multi Polygon)

all are imported just fine with v.in.ogr in=NHDmajor.gdb out=NHDmajor

OGR layers are translated to GRASS layers, i.e. features of OGR layer 1: NHD_MajorStreams are in GRASS layer 1, features of OGR layer 2: NHD_MajorAreas are in GRASS layer 2, and features of OGR layer 3: NHD_MajorWaterbodies are in GRASS layer 3.
Check with v.category input=NHDmajor option=report

2016WSDACropDistribution.gdb is available at

https://agr.wa.gov/PestFert/NatResources/docs/2016WSDACropDistribution.gdb.zip

and contains 2 layers
1: WSDACrop_2016 (Multi Polygon)
2: CropData (None)

the second layer is, according to OGR, empty, so it might be better to skip it

Importing 2016WSDACropDistribution.gdb with
v.in.ogr in=2016WSDACropDistribution.gdb layer=WSDACrop_2016 out=2016WSDACropDistribution
succeeds if multi-surface geometries are skipped by v.in.ogr (as of trunk r71508).

Markus M