[GRASS-user] Encountering an error importing shapefiles with v.in.ogr

List:

I am using GRASS 6.2.1 and I (sometimes) encounter an error importing a shapefile with v.in.ogr. The vector boundaries import fine, but gis.m crashes. I can re-start gis.m and load the vector file that I just *attempted* to import and it displays fine. However, I get a warning:

Cannot display areas, topology not available.

I am virtually certain that I was able to successfully import this and other shapefiles in previous versions of GRASS (GRASS 4.x & GRASS 5.x). The shapefiles files include the *.dbf, *.shp, and *.shx files, which I think, should be enough. If I import shapefiles from the US National Atlas (created by the USGS), I have no problems. It seems that with all shapefiles generated by my office using ArcGIS 9.0, I have this problem.

Does anyone have suggestions as to what could be going on? I would like to use v.rast.stats using the imported vector files, but given the error/warning, v.rast.stats will not work.

Regards,
Tom

--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL: thomas.adams@noaa.gov

VOICE: 937-383-0528
FAX: 937-383-0033

Cannot display areas, topology not available.

I am virtually certain that I was able to successfully import this and
other shapefiles in previous versions of GRASS (GRASS 4.x & GRASS 5.x).
The shapefiles files include the *.dbf, *.shp, and *.shx files, which I
think, should be enough. If I import shapefiles from the US National
Atlas (created by the USGS), I have no problems. It seems that with all
shapefiles generated by my office using ArcGIS 9.0, I have this problem.

Similar problem with shapefiles generated using ArcGIS, I recently posted a topic about (some) areas which are not available after v.in.ogr.

Does anyone have suggestions as to what could be going on?

Hamish suggested using 'v.in.ogr -c ’ (does not clean polygons) which didn’t worked for me.
I partially solved using v.in.ogr without min_area and snap parameters but when patching adjacent shapes I do not some polygons lost area.
Are you experiencing something similar with ArcGIS shapes?

regards
raffaele

Raffaele,

The -c option did the trick! Thank you very much — I had missed the suggestion by Hamish. Does this mean a bug exists in v.in.ogr that necessitates using this option? All the boundaries seem to have imported fine for me.

Regards,
Tom

Raffaele Morelli wrote:

    Cannot display areas, topology not available.

    I am virtually certain that I was able to successfully import this
    and
    other shapefiles in previous versions of GRASS (GRASS 4.x & GRASS
    5.x).
    The shapefiles files include the *.dbf, *.shp, and *.shx files,
    which I
    think, should be enough. If I import shapefiles from the US National
    Atlas (created by the USGS), I have no problems. It seems that
    with all
    shapefiles generated by my office using ArcGIS 9.0, I have this
    problem.

Similar problem with shapefiles generated using ArcGIS, I recently posted a topic about (some) areas which are not available after v.in.ogr.

    Does anyone have suggestions as to what could be going on?

Hamish suggested using 'v.in.ogr -c ' (does not clean polygons) which didn't worked for me.
I partially solved using v.in.ogr without min_area and snap parameters but when patching adjacent shapes I do not some polygons lost area.
Are you experiencing something similar with ArcGIS shapes?

regards
raffaele
------------------------------------------------------------------------

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser
  
--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL: thomas.adams@noaa.gov

VOICE: 937-383-0528
FAX: 937-383-0033

Thomas Adams wrote:

List:

I am using GRASS 6.2.1 and I (sometimes) encounter an error importing a
shapefile with v.in.ogr. The vector boundaries import fine, but gis.m
crashes. I can re-start gis.m and load the vector file that I just
*attempted* to import and it displays fine. However, I get a warning:

Cannot display areas, topology not available.

This might mean that v.in.ogr failed (eg. a segmenation fault) at work,
while such errors are not printed to the tcl/tk GUI output. Please try
to run the same v.in.ogr command from the command line. Let us know if
there is any error printed, which was missing in GUI.

I am virtually certain that I was able to successfully import this and
other shapefiles in previous versions of GRASS (GRASS 4.x & GRASS 5.x).
The shapefiles files include the *.dbf, *.shp, and *.shx files, which I
think, should be enough. If I import shapefiles from the US National
Atlas (created by the USGS), I have no problems. It seems that with all
shapefiles generated by my office using ArcGIS 9.0, I have this problem.

Does anyone have suggestions as to what could be going on?

To check whether there is a possible error in your shapefile, inspect
the ogrinfo -al -so output, try to open it in QGIS, OpenEV or else. Any
oddities? Does ogr2ogr dump.shp your_input.shp work? Does it create a
copy or maybe something you would not expect?

Can you put a problematic sample somewhere for dowload?

Cheers,
Maciek

Maciej,

Very interesting… I did as you suggested. I ran v.in.ogr from the command line and it worked *perfectly*! So, I deleted the vector file -- and using the same options -- the import failed using the gis.m GUI!!! The options I used in both cases were:

min_area=0.0001
snap=-1
--overwrite
-o

I could email the shapefile (*tar.gz file is about 1.6 MB) to you (lat-long coordinates). The shapefile consists of 686 areas.

Regards,
Tom

Maciej Sieczka wrote:

Thomas Adams wrote:
  

List:

I am using GRASS 6.2.1 and I (sometimes) encounter an error importing a
shapefile with v.in.ogr. The vector boundaries import fine, but gis.m
crashes. I can re-start gis.m and load the vector file that I just
*attempted* to import and it displays fine. However, I get a warning:

Cannot display areas, topology not available.
    
This might mean that v.in.ogr failed (eg. a segmenation fault) at work,
while such errors are not printed to the tcl/tk GUI output. Please try
to run the same v.in.ogr command from the command line. Let us know if
there is any error printed, which was missing in GUI.

I am virtually certain that I was able to successfully import this and
other shapefiles in previous versions of GRASS (GRASS 4.x & GRASS 5.x).
The shapefiles files include the *.dbf, *.shp, and *.shx files, which I
think, should be enough. If I import shapefiles from the US National
Atlas (created by the USGS), I have no problems. It seems that with all
shapefiles generated by my office using ArcGIS 9.0, I have this problem.

Does anyone have suggestions as to what could be going on?
    
To check whether there is a possible error in your shapefile, inspect
the ogrinfo -al -so output, try to open it in QGIS, OpenEV or else. Any
oddities? Does ogr2ogr dump.shp your_input.shp work? Does it create a
copy or maybe something you would not expect?

Can you put a problematic sample somewhere for dowload?

Cheers,
Maciek
  
--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL: thomas.adams@noaa.gov

VOICE: 937-383-0528
FAX: 937-383-0033

FWIW, running v.to.rast also crashes the GUI for no apparent reason.

Michael

On 3/19/07 11:19 AM, "Maciej Sieczka" <tutey@o2.pl> wrote:

Thomas Adams wrote:

List:

I am using GRASS 6.2.1 and I (sometimes) encounter an error importing a
shapefile with v.in.ogr. The vector boundaries import fine, but gis.m
crashes. I can re-start gis.m and load the vector file that I just
*attempted* to import and it displays fine. However, I get a warning:

Cannot display areas, topology not available.

This might mean that v.in.ogr failed (eg. a segmenation fault) at work,
while such errors are not printed to the tcl/tk GUI output. Please try
to run the same v.in.ogr command from the command line. Let us know if
there is any error printed, which was missing in GUI.

I am virtually certain that I was able to successfully import this and
other shapefiles in previous versions of GRASS (GRASS 4.x & GRASS 5.x).
The shapefiles files include the *.dbf, *.shp, and *.shx files, which I
think, should be enough. If I import shapefiles from the US National
Atlas (created by the USGS), I have no problems. It seems that with all
shapefiles generated by my office using ArcGIS 9.0, I have this problem.

Does anyone have suggestions as to what could be going on?

To check whether there is a possible error in your shapefile, inspect
the ogrinfo -al -so output, try to open it in QGIS, OpenEV or else. Any
oddities? Does ogr2ogr dump.shp your_input.shp work? Does it create a
copy or maybe something you would not expect?

Can you put a problematic sample somewhere for dowload?

Cheers,
Maciek

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

Raffaele,

After further testing, I do see the same problem you have had, namely,"(some) areas which are not available after using v.in.ogr." This is very apparent if I randomly color the polygons — some do not get filled. Also, if I do a v.to.rast conversion, I get holes in the newly created raster.

Does anyone have thoughts on this?

Regards,
Tom

Raffaele Morelli wrote:

    Cannot display areas, topology not available.

    I am virtually certain that I was able to successfully import this
    and
    other shapefiles in previous versions of GRASS (GRASS 4.x & GRASS
    5.x).
    The shapefiles files include the *.dbf, *.shp, and *.shx files,
    which I
    think, should be enough. If I import shapefiles from the US National
    Atlas (created by the USGS), I have no problems. It seems that
    with all
    shapefiles generated by my office using ArcGIS 9.0, I have this
    problem.

Similar problem with shapefiles generated using ArcGIS, I recently posted a topic about (some) areas which are not available after v.in.ogr.

    Does anyone have suggestions as to what could be going on?

Hamish suggested using 'v.in.ogr -c ' (does not clean polygons) which didn't worked for me.
I partially solved using v.in.ogr without min_area and snap parameters but when patching adjacent shapes I do not some polygons lost area.
Are you experiencing something similar with ArcGIS shapes?

regards
raffaele
------------------------------------------------------------------------

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser
  
--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL: thomas.adams@noaa.gov

VOICE: 937-383-0528
FAX: 937-383-0033

2007/3/21, Thomas Adams <Thomas.Adams@noaa.gov>:

Raffaele,

After further testing, I do see the same problem you have had,
namely,“(some) areas which are not available after using v.in.ogr.” This
is very apparent if I randomly color the polygons — some do not get
filled. Also, if I do a v.to.rast conversion, I get holes in the newly
created raster.

Does anyone have thoughts on this?

Regards,
Tom

Did you try patching adjacent shapes (2 or more) coming from ArcGIS and see what happens to the resulting?
In this case I see some polygons lost area, even if each input shape is correctly displayed.

Can you do this further test?

Cleaning the result shape using a simple
v.clean input=x output=x_clean tool=bpol,rmdupl error=err (as suggested in v.clean man pages to deal with vector originating from shape files)
gives a better result but still I have polygons without area.

thanx
raffaele

On 22/03/07 10:14, Raffaele Morelli wrote:

2007/3/21, Thomas Adams <Thomas.Adams@noaa.gov <mailto:Thomas.Adams@noaa.gov>>:

    Raffaele,

    After further testing, I do see the same problem you have had,
    namely,"(some) areas which are not available after using v.in.ogr." This
    is very apparent if I randomly color the polygons — some do not get
    filled. Also, if I do a v.to.rast conversion, I get holes in the newly
    created raster.

    Does anyone have thoughts on this?

    Regards,
    Tom

Did you try patching adjacent shapes (2 or more) coming from ArcGIS and see what happens to the resulting?
In this case I see some polygons lost area, even if each input shape is correctly displayed.

Can you do this further test?

Cleaning the result shape using a simple
v.clean input=x output=x_clean tool=bpol,rmdupl error=err (as suggested in v.clean man pages to deal with vector originating from shape files)
gives a better result but still I have polygons without area.

You can try to rerun the entire cleaning operation that v.in.ogr uses, i.e.:

v.clean in=inmap out=outmap_clean_vinogr
tool=snap,bpol,rmdupl,break,rmdupl,rmsa,chdangle,rmdangle,chbridge,rmbridge
thresh=0.000001

and maybe play around with the thresh parameter, depending on your projection and data resolution.

Moritz

Moritz Lennert wrote:

You can try to rerun the entire cleaning operation that v.in.ogr uses,
i.e.:

v.clean in=inmap out=outmap_clean_vinogr
tool=snap,bpol,rmdupl,break,rmdupl,rmsa,chdangle,rmdangle,chbridge,rm
bridge thresh=0.000001

and maybe play around with the thresh parameter, depending on your
projection and data resolution.

Hi,

Radim often made it known that 'v.in.ogr -c' + v.clean is not the same
as v.in.ogr's built-in cleaning.

Hamish

2007/3/22, Hamish <hamish_nospam@yahoo.com>:

Moritz Lennert wrote:

You can try to rerun the entire cleaning operation that v.in.ogr uses,
i.e.:

v.clean in=inmap out=outmap_clean_vinogr
tool=snap,bpol,rmdupl,break,rmdupl,rmsa,chdangle,rmdangle,chbridge,rm
bridge thresh=0.000001

and maybe play around with the thresh parameter, depending on your
projection and data resolution.

Hi,

Radim often made it known that ‘v.in.ogr -c’ + v.clean is not the same
as v.in.ogr’s built-in cleaning.

Can you point me to this resource? (if other than both v.in.ogr and v.clean man pages)
I would really appreciate to do further reading on this as often shape files comes from arcgis (quite always in my case) and some “massaging” must be done in order to get them properly usable with grass.

Should all these affect the patching of v.clean(ed) shapes and subsequent missing areas in the result?

Hamish

regards
raffaele