[GRASS-user] Exporting attributes to GMT ASCII format using v.out.ogr

Hi,

I'm using v.out.ogr to export GRASS vectors to GMT format. The geometry
exports fine, but the attributes don't seem to be in the GMT file after
the export finishes. I can see the attribute column names in the GMT
header portion of the file, but all I get in the data columns are the x
and y, followed by a zero in the third column.

Any special CREATEOPT parameters that need to be passed? I checked on
the OGR website and there wasn't any hints about it; same with the
v.out.ogr manual (GMT format isn't even mentioned there).

Thanks,

--
Eric Patton

Eric:

I'm using v.out.ogr to export GRASS vectors to GMT format.
The geometry exports fine, but the attributes don't seem
to be in the GMT file after the export finishes. I can see
the attribute column names in the GMT header portion of
the file, but all I get in the data columns are the x
and y, followed by a zero in the third column.

Any special CREATEOPT parameters that need to be passed? I
checked on the OGR website and there wasn't any hints about
it; same with the v.out.ogr manual (GMT format isn't even
mentioned there).

no new help to offer, but if you find something out it would be
good to add it to the wiki page:

   http://grass.osgeo.org/wiki/GMT#Vector

if nothing on the format page at the GDAL/OGR website, for CREATEOPT
you might have to go exploring in the OGR source code.

Hamish

Hamish wrote:

Eric:

I'm using v.out.ogr to export GRASS vectors to GMT format.
The geometry exports fine, but the attributes don't seem
to be in the GMT file after the export finishes. I can see
the attribute column names in the GMT header portion of
the file, but all I get in the data columns are the x
and y, followed by a zero in the third column.

Any special CREATEOPT parameters that need to be passed? I
checked on the OGR website and there wasn't any hints about
it; same with the v.out.ogr manual (GMT format isn't even
mentioned there).

no new help to offer, but if you find something out it would be
good to add it to the wiki page:

   http://grass.osgeo.org/wiki/GMT#Vector

if nothing on the format page at the GDAL/OGR website, for CREATEOPT
you might have to go exploring in the OGR source code.

A plain: v.out.ogr RBD_F1v3 format=GMT dsn=RBD_F1v3.gmt results into:

# FEATURE_DATA

# @D||||||||||||||||||||||||||

but v.out.ogr RBD_F1v3 format=GMT type=area dsn=RBD_F1v3.gmt gives:

# FEATURE_DATA

# @D1|"Fleuves et cours d'eau cotiers de la Guyane"|fr|FR|"Guyana (French)"|83892.657134|W1001|FRW1001|FRK||"North Western Atlantic Ocean"|"Open Ocean"||W10000000|FRW10000000|W1|N|Y|2005-06-03|FR1||2008-02-26|ASB|136|FRK|1660787.48438|83892657133.7

Hope this helps, Hermann

Hermann wrote:

A plain: v.out.ogr RBD_F1v3 format=GMT dsn=RBD_F1v3.gmt
results into:

# FEATURE_DATA
>
# @D||||||||||||||||||||||||||

but v.out.ogr RBD_F1v3 format=GMT type=area dsn=RBD_F1v3.gmt gives:

# FEATURE_DATA
>
# @D1|"Fleuves et cours d'eau cotiers de la Guyane"|fr|FR|"Guyana
(French)"|83892.657134|W1001|FRW1001|FRK||"North Western Atlantic Ocean"|"Open Ocean"||W10000000|FRW10000000|W1|N|Y|2005-06-03|FR1||2008-02-26|ASB|136|FRK|1660787.48438|83892657133.7

Hope this helps, Hermann

I think it does, the default for v.out.ogr is type=line,boundary

tip added in http://grass.osgeo.org/wiki/GMT#Vector

I would ask if it acts any differently in latest grass 6.5 or 7 svn builds? (6.5 change may be reverted as it may break
backwards compatibility / expected behaviour)

Hamish

Hamish wrote:

Hermann wrote:
> A plain: v.out.ogr RBD_F1v3 format=GMT dsn=RBD_F1v3.gmt
> results into:
>
> # FEATURE_DATA
> >
> # @D||||||||||||||||||||||||||
>
>
> but v.out.ogr RBD_F1v3 format=GMT type=area dsn=RBD_F1v3.gmt gives:
>
> # FEATURE_DATA
> >
> # @D1|"Fleuves et cours d'eau cotiers de la Guyane"|fr|FR|"Guyana
> (French)"|83892.657134|W1001|FRW1001|FRK||"North Western Atlantic Ocean"|"Open Ocean"||W10000000|FRW10000000|W1|N|Y|2005-06-03|FR1||2008-02-26|ASB|136|FRK|1660787.48438|83892657133.7
>
>
> Hope this helps, Hermann

I think it does, the default for v.out.ogr is type=line,boundary

tip added in http://grass.osgeo.org/wiki/GMT#Vector

Yes, that was the problem I was having - wrong or missing type
parameter.

I would ask if it acts any differently in latest grass 6.5 or 7 svn builds? (6.5 change may be reverted as it may break
backwards compatibility / expected behaviour)

Hamish

Which change are you referring to? I'm using the latest 6.5.svn, and all
seems to run smoothly.

--
Eric Patton

Hamish:

> I would ask if it acts any differently in latest grass
> 6.5 or 7 svn builds? (6.5 change may be reverted as it may
> break backwards compatibility / expected behaviour)

Eric:

Which change are you referring to? I'm using the latest
6.5.svn, and all seems to run smoothly.

make that "in new cases make things better, but subtly break backwards compatibility / expected behaviour in existing scripts."
ie an old script for 6.x should produce the same output as a new script at the cost of the default action not being as nice.
I don't really know if this is just hypothetical or if it could really screw somebody up. (ie if it matters or not)

r39128
https://trac.osgeo.org/grass/log/grass/branches/develbranch_6/vector/v.out.ogr

Hamish