[GRASS-user] Importing data in .atx/.gdb format

   Reading the wiki pages on importing ESRI data I did not see anything
relating to .gdb files. The state's geospatial data center assumes the
entire world runs Microsoft and ESRI products and their data for state
transportaion (highways, roads, streets) comes with these file extensions
(among others):

.CatItemTypesByName.atx
.CatItemTypesByParentTypeID.atx
.CatItemTypesByUUID.atx
.gdbindexes
.gdbtable
.gdbtablx

   Is there a module that will import these as GRASS vector files with
associated attribute data?

TIA,

Rich

Rich Shepard wrote

Reading the wiki pages on importing ESRI data I did not see anything
relating to .gdb files. The state's geospatial data center assumes the
entire world runs Microsoft and ESRI products and their data for state
transportaion (highways, roads, streets) comes with these file extensions
(among others):

.CatItemTypesByName.atx
.CatItemTypesByParentTypeID.atx
.CatItemTypesByUUID.atx
.gdbindexes
.gdbtable
.gdbtablx

   Is there a module that will import these as GRASS vector files with
associated attribute data?

GRASS GIS uses the underlying gdal/ogr for (raster and vector) import.

Thus you have to look at formats in gdal/ogr :

http://www.gdal.org/ogr_formats.html

and compare it with available formats within your gdal /ogr installation.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Importing-data-in-atx-gdb-format-tp5285623p5285624.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Tue, 13 Sep 2016, Even Rouault wrote:

you can use v.in.ogr on the .gdb directory that contains the files you
mention below. That will use underneath the OGR OpenFileGDB driver :
http://gdal.org/drv_openfilegdb.html

Even,

   Thank you very much. If I knew how to add to the wiki import page I'd add
this information there.

Regards,

Rich

On Tue, 13 Sep 2016, Helmut Kudrnovsky wrote:

GRASS GIS uses the underlying gdal/ogr for (raster and vector) import.

Helmut,

   Thank you. I looked on the Wiki, not specific module pages.

Regards,

Rich

Rich,

On Tue, Sep 13, 2016 at 7:55 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Tue, 13 Sep 2016, Helmut Kudrnovsky wrote:

GRASS GIS uses the underlying gdal/ogr for (raster and vector) import.

Helmut,

  Thank you. I looked on the Wiki, not specific module pages.

Please let us know on which Wiki page you would expect this information.
Then we may expand that part.

Best
Markus

On Tue, 13 Sep 2016, Markus Neteler wrote:

Please let us know on which Wiki page you would expect this information.
Then we may expand that part.

Markus,

   Here's where I started looking:
<https://grasswiki.osgeo.org/wiki/Importing_data&gt;

Regards,

Rich

Rich,

On Tue, Sep 13, 2016 at 8:28 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Tue, 13 Sep 2016, Markus Neteler wrote:

Please let us know on which Wiki page you would expect this information.
Then we may expand that part.

Markus,

  Here's where I started looking:
<https://grasswiki.osgeo.org/wiki/Importing_data&gt;

Yes - it reads:

Getting your data into GRASS

GRASS supports many common GIS formats, and many uncommon ones too.

The primary import/export tool is called GDAL/OGR. It is the Rosetta
Stone of the free GIS world:

- Supported raster formats via r.in.gdal (for example importing GeoTiffs)
- Supported vector formats via v.in.ogr (for example importing Shapefiles)

Please suggest what to add (or you may edit directly).

Best
Markus

On Tue, 13 Sep 2016, Markus Neteler wrote:

GRASS supports many common GIS formats, and many uncommon ones too.
The primary import/export tool is called GDAL/OGR. It is the Rosetta
Stone of the free GIS world:
- Supported raster formats via r.in.gdal (for example importing GeoTiffs)
- Supported vector formats via v.in.ogr (for example importing Shapefiles)

Please suggest what to add (or you may edit directly).

Markus,

   Raster files such as those available in ESRI Grid format include a file
named prj.adf. That's a pretty good clue it contains the projection
informaiton that grass needs to create a location.

   Vector files available as ESRI Shapefiles include a *.prj which grass uses
to define a location's projection.

   The vector files available in ESRI, Garmin, etc. open file grid format
have extensions of .atx, .gdb*, and .spx; at least, those are the ones I
see in the transportation map I want to import. They all seem to be database
files, not projection files. I've tried the .atx and several flavors of
.gdb* without success.

   And, now that I moved ~/grassdata to ~/data/grassdata (and modified
~/.grass7/rc to reflect the new path) grass does not recognize
~/data/grassdata/ODOT2014/ as a location available for selection in the
initial dialog box.

   What I'd like to learn is how to specify a location using .atx or .gdb
files. Then I could move these data in there and import them prior to
reprojecting them to the current project subdirectory. I'd be happy to write
this procedure on the wiki page once I had something useful to write.

Thanks,

Rich

Hei Rich,

Relatively recent, the OpenFileGDB driver got implemented in GDAL/OGR.
Until then one had to compile it with a FileGDB SDK from ESRI.

Both drivers do unfortunately not support raster data (though someone is or at least has been working on that).

Thus, you should be able to import your transport data (assuming it is vector) with v.in.ogr. A FGDB is as you say also a folder, but if I am not mistaken you do not have to provide special files to OGR:

I never tried it myself, but something like this should work:
v.in.ogr input=your_FGDB_folder layer=the_relevant_layer output=your_output

A list of available layers should be accessible like this:
v.in.ogr input=your_FGDB_folder -l

Hope that helps.

Kind regards,
Stefan

-----Original Message-----
From: grass-user [mailto:grass-user-bounces@lists.osgeo.org] On Behalf Of Rich Shepard
Sent: 13. september 2016 23:47
To: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] Importing data in .atx/.gdb format

On Tue, 13 Sep 2016, Markus Neteler wrote:

GRASS supports many common GIS formats, and many uncommon ones too.
The primary import/export tool is called GDAL/OGR. It is the Rosetta
Stone of the free GIS world:
- Supported raster formats via r.in.gdal (for example importing
GeoTiffs)
- Supported vector formats via v.in.ogr (for example importing
Shapefiles)

Please suggest what to add (or you may edit directly).

Markus,

   Raster files such as those available in ESRI Grid format include a file named prj.adf. That's a pretty good clue it contains the projection informaiton that grass needs to create a location.

   Vector files available as ESRI Shapefiles include a *.prj which grass uses to define a location's projection.

   The vector files available in ESRI, Garmin, etc. open file grid format have extensions of .atx, .gdb*, and .spx; at least, those are the ones I see in the transportation map I want to import. They all seem to be database files, not projection files. I've tried the .atx and several flavors of
.gdb* without success.

   And, now that I moved ~/grassdata to ~/data/grassdata (and modified ~/.grass7/rc to reflect the new path) grass does not recognize ~/data/grassdata/ODOT2014/ as a location available for selection in the initial dialog box.

   What I'd like to learn is how to specify a location using .atx or .gdb files. Then I could move these data in there and import them prior to reprojecting them to the current project subdirectory. I'd be happy to write this procedure on the wiki page once I had something useful to write.

Thanks,

Rich

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

On Tue, 13 Sep 2016, Blumentrath, Stefan wrote:

Thus, you should be able to import your transport data (assuming it is
vector) with v.in.ogr. A FGDB is as you say also a folder, but if I am not
mistaken you do not have to provide special files to OGR:
v.in.ogr input=your_FGDB_folder layer=the_relevant_layer output=your_output

Stefan,

   This almost works -- using the GUI. I've no idea which file represnts the
relevant layer.

   Selecting File -> Import vector (v.in.ogr) opens the dialog box. There, I
change the source type radiobox choice from File to Directory, use the
dropdown choice list for Source list format to OpenFileGDB, and select the
Directory as ~/data/grassdata/ODOT2014.

   The bottom checkbox of options doesn't matter because when I click the
Import button a message box displays reading, "No layers selected. Operation
canceled." That's because all layers were greyed out when I selected that
directory.

   When I try specifing source type as File grass does not like my selecting
a filename with 'index' in the extension.

A list of available layers should be accessible like this:
v.in.ogr input=your_FGDB_folder -l

v.in.ogr input=~/data/grassdata/ODOT2014 -l

ERROR: Unable to open data source </home/rshepard/data/grassdata/ODOT2014>

Thanks,

Rich

Rich Shepard wrote

On Tue, 13 Sep 2016, Blumentrath, Stefan wrote:

Thus, you should be able to import your transport data (assuming it is
vector) with v.in.ogr. A FGDB is as you say also a folder, but if I am
not
mistaken you do not have to provide special files to OGR:
v.in.ogr input=your_FGDB_folder layer=the_relevant_layer
output=your_output

Stefan,

   This almost works -- using the GUI. I've no idea which file represnts
the
relevant layer.

   Selecting File -> Import vector (v.in.ogr) opens the dialog box. There,
I
change the source type radiobox choice from File to Directory, use the
dropdown choice list for Source list format to OpenFileGDB, and select the
Directory as ~/data/grassdata/ODOT2014.

   The bottom checkbox of options doesn't matter because when I click the
Import button a message box displays reading, "No layers selected.
Operation
canceled." That's because all layers were greyed out when I selected that
directory.

   When I try specifing source type as File grass does not like my
selecting
a filename with 'index' in the extension.

A list of available layers should be accessible like this:
v.in.ogr input=your_FGDB_folder -l

v.in.ogr input=~/data/grassdata/ODOT2014 -l

ERROR: Unable to open data source
&lt;/home/rshepard/data/grassdata/ODOT2014&gt;

Thanks,

Rich

_______________________________________________
grass-user mailing list

grass-user@.osgeo

http://lists.osgeo.org/mailman/listinfo/grass-user

As mentioned in an earlier reply before, GRASS GIS uses for import gdal
/ogr.

so have a look at www.gdal.org and check the 2 drivers for this filegdb
format how gdal /ogr handles this format.

The next step may be :

- ogrinfo your_filegdb_folder to see if your gdal /ogr installation is
capable to read this kind of data and if yes, to see which layer(s) are
inside this data

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Importing-data-in-atx-gdb-format-tp5285623p5285714.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hei Rich,

Regarding the v.in.ogr command, I was a bit unclear (with folder I meant the "FGDB object" whit the .gdb ending, which the OS treats a folder)

For me:
v.in.ogr -l input=D:\Geodatabases\Topographic_data_2014.gdb
works without issues.

As Helmut wrote, if that does not work you should check if your GDAL installation supports FGDB:
ogrinfo --formats

Kind regards,
Stefan

-----Original Message-----
From: grass-user [mailto:grass-user-bounces@lists.osgeo.org] On Behalf Of Helmut Kudrnovsky
Sent: 14. september 2016 07:25
To: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Importing data in .atx/.gdb format

Rich Shepard wrote

On Tue, 13 Sep 2016, Blumentrath, Stefan wrote:

Thus, you should be able to import your transport data (assuming it
is
vector) with v.in.ogr. A FGDB is as you say also a folder, but if I
am not mistaken you do not have to provide special files to OGR:
v.in.ogr input=your_FGDB_folder layer=the_relevant_layer
output=your_output

Stefan,

   This almost works -- using the GUI. I've no idea which file
represnts the relevant layer.

   Selecting File -> Import vector (v.in.ogr) opens the dialog box.
There, I change the source type radiobox choice from File to
Directory, use the dropdown choice list for Source list format to
OpenFileGDB, and select the Directory as ~/data/grassdata/ODOT2014.

   The bottom checkbox of options doesn't matter because when I click
the Import button a message box displays reading, "No layers selected.
Operation
canceled." That's because all layers were greyed out when I selected
that directory.

   When I try specifing source type as File grass does not like my
selecting a filename with 'index' in the extension.

A list of available layers should be accessible like this:
v.in.ogr input=your_FGDB_folder -l

v.in.ogr input=~/data/grassdata/ODOT2014 -l

ERROR: Unable to open data source
&lt;/home/rshepard/data/grassdata/ODOT2014&gt;

Thanks,

Rich

_______________________________________________
grass-user mailing list

grass-user@.osgeo

http://lists.osgeo.org/mailman/listinfo/grass-user

As mentioned in an earlier reply before, GRASS GIS uses for import gdal /ogr.

so have a look at www.gdal.org and check the 2 drivers for this filegdb format how gdal /ogr handles this format.

The next step may be :

- ogrinfo your_filegdb_folder to see if your gdal /ogr installation is capable to read this kind of data and if yes, to see which layer(s) are inside this data

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Importing-data-in-atx-gdb-format-tp5285623p5285714.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Wed, Sep 14, 2016 at 1:55 AM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Tue, 13 Sep 2016, Blumentrath, Stefan wrote:

Thus, you should be able to import your transport data (assuming it is
vector) with v.in.ogr. A FGDB is as you say also a folder, but if I am not
mistaken you do not have to provide special files to OGR:
v.in.ogr input=your_FGDB_folder layer=the_relevant_layer
output=your_output

Stefan,

  This almost works -- using the GUI. I've no idea which file represnts the
relevant layer.

There is no need to know which file represents the relevant layer.
This is actually the wrong question because a layer can be part of a
file, a file, multiple files, a directory, part of a (local or remote)
database, a WMS query etc, depending on the OGR-recognized format. On
the commandline, v.in.ogr input=datasourcename -l will list all layers
recognized by OGR where datasourcename can be pretty much anything.

Markus M

On Wed, 14 Sep 2016, Blumentrath, Stefan wrote:

Regarding the v.in.ogr command, I was a bit unclear (with folder I meant
the "FGDB object" whit the .gdb ending, which the OS treats a folder)

Stefan,

   Thanks for clarifying. I understood that 'folder' was Microsoft's name for
'directory.'

For me:
v.in.ogr -l input=D:\Geodatabases\Topographic_data_2014.gdb
works without issues.

   Perhaps this is part of the problem: none of my files have a simple .gdb
extention:

a00000001.gdbindexes
a00000001.gdbtable
a00000001.gdbtablx

As Helmut wrote, if that does not work you should check if your GDAL
installation supports FGDB: ogrinfo --formats

   I'll read that web page again and see how gdal is built here. Since I have
the source I can easily rebuild it.

Thanks,

Rich

On Wed, 14 Sep 2016, Markus Metz wrote:

There is no need to know which file represents the relevant layer. This is
actually the wrong question because a layer can be part of a file, a file,
multiple files, a directory, part of a (local or remote) database, a WMS
query etc, depending on the OGR-recognized format. On the commandline,
v.in.ogr input=datasourcename -l will list all layers recognized by OGR
where datasourcename can be pretty much anything.

Markus,

   Thank you. I will probably need to rebuild gdal here.

Regards,

Rich

On Wed, 14 Sep 2016, Blumentrath, Stefan wrote:

As Helmut wrote, if that does not work you should check if your GDAL installation supports FGDB:
ogrinfo --formats

   Ah, I did this yesterday, too:

$ ogrinfo --formats
Supported Formats:
   ...
   -> "OpenFileGDB" (readonly)
   ...

   So, I'll use the command line and specify only the directory name.
However, as I wrote earlier, no file has a simple .gdb extention.

   I'll call the state's geospatial data office this morning and see what
they have to say.

Thanks,

Rich

However, as I wrote earlier, no file has a simple .gdb extention.

As Markus M. and Stefan B. and me mentioned before; don't look for a file.

It is the folder /directory where all the atx etc live, you have to specify
for ogrinfo or v.in.ogr!

this folder/directory can have any name: your_data_folder,
your_data_folder.gdb or whatever...

so the command will be

e.g.

ogrinfo the_directory_where_all_the_atx_stuff_lives

Or

V.in.ogr the_directory_where_all_the_atx_stuff_lives

Please have a look at www.gdal.org, there is a very nice description of this
data type and how it works with ogr which is used by GRASS import modules.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Importing-data-in-atx-gdb-format-tp5285623p5285846.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Wed, 14 Sep 2016, Helmut Kudrnovsky wrote:

As Markus M. and Stefan B. and me mentioned before; don't look for a file.
It is the folder /directory where all the atx etc live, you have to
specify for ogrinfo or v.in.ogr!

Helmut,

   Got it.

Thanks,

Rich

Please have a look at www.gdal.org, there is a very nice description >of

this data type and how it works with ogr which is used by GRASS >import
modules.

http://www.gdal.org/drv_openfilegdb.html

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Importing-data-in-atx-gdb-format-tp5285623p5285848.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Wed, 14 Sep 2016, Helmut Kudrnovsky wrote:

http://www.gdal.org/drv_openfilegdb.html

   Based on this line I get potentially useful information from grass:
"A specific .gdbtable file (including "system" tables) can also be opened
directly."

   Still cannot use the directory as the input target:

v.in.ogr input=~/data/grassdata/or-trans/

ERROR: Unable to open data source </home/rshepard/data/grassdata/or-trans/>

However, a single .gdbtable file produces this output:

v.in.ogr input=~/data/grassdata/or-trans/a00000001.gdbtable

WARNING: All available OGR layers will be imported into vector map
          <GDB_SystemCatalog>
ERROR: Projection of dataset does not appear to match current location.

        GRASS LOCATION PROJ_INFO is:
        name: NAD_1983_HARN_StatePlane_Oregon_North_FIPS_3601_Feet_Intl
        datum: nad83harn
        ellps: grs80
        proj: lcc
        lat_1: 44.33333333333334
        lat_2: 46
        lat_0: 43.66666666666666
        lon_0: -120.5
        x_0: 2500000
        y_0: 0
        no_defs: defined

        Import dataset PROJ_INFO is:
        Dataset proj = 0 (unreferenced/unknown)

        In case of no significant differences in the projection definitions,
        use the -o flag to ignore them and use current location definition.
        Consider generating a new location with 'location' parameter from
        input data set.

   This tells me that the source data might be in long-lat and not projected.
Since grass will not display the source files' location name I will move
them to the WGS84/ long-lat location.

   This still does not import the files. Using the GUI and selecting
Directory and OpenFileGDB format all files are greyed out and grass won't
open anything because no file has been selected.

   Changing to File with OpenFileGDB format and selecting a single .gdbtable
file produces these results:

(Wed Sep 14 07:50:52 2016) v.import input=/home/rshepard/data/grassdata/WGS84/odot2014/a00000001.gdbtable layer=GDB_SystemCatalog output=GDB_SystemCatalog --overwrite
WARNING: All available OGR layers will be imported into vector map <GDB_SystemCatalog>
ERROR: Coordinate reference system not available for input </home/rshepard/data/grassdata/WGS84/odot2014/a00000001.gdbtable>
(Wed Sep 14 07:50:52 2016) Command finished (0 sec)

   I'm not ignoring what Stefan, Helmut, and Markus are writing, and I have
again read the gdal.org web page on ESRI OpenFileGDB, but I'm not getting
the expected results.

   If there's no available reference system there must be something broken or
incomplete in the source tarball. I'll contact the repository this morning
and let you know what I learn.

Thanks,

Rich