[GRASS-user] obtaining spatial data from shapefile maps
Micha Silver
micha at arava.co.il
Mon Jul 7 13:45:40 EDT 2008
Richard Peskin wrote:
> I want to use GRASS (and QGIS) for analysis of water well locations in
> a town. The basic data has been provided thru (ARCWare) shapefiles.
> While input of data to create the well location point maps is no
> problem, the shapefile format embeds the "real" spatial location data
> in a proprietary file (the .shx index files). So I can input shapefile
> data, including the dBase attributes, I can't get at the spatial
> locations; consequently I can't correct for any location errors made
> as a result of data input mistakes. Is there a way to access these
> shapefile index files using GRASS? Or is there a way I can use that
> fact that I can produce a GRASS location map of points to obtain (say
> a table
If I understand correctly, you need the X-Y locations for a point
shapefile as attributes.
I know of three approaches you can choose from:
1- In QGIS, grab Carson Farmer's "Calculate Geometry" plugin. It creates
a new shapefile with XCOORD and YCOORD columns for point shapes.
2- In GRASS (assuming you have imported the shapefile as a GRASS vector)
you can do v.out.ascii to get a text file with point coordinates. But
you loose the other attributes.
3- Again in GRASS, add two columns to the vector table (v.db.addcol)
with type 'double precision'. THen run v.to.db with the coor option to
add X-Y values to the table in those new columns.
> of) (x,y) relative to some know location on the map? If I could solve
> this problem, I could probably move the whole well data set out of
> shapefiles and into more accessible database system, e.g. MySql.
Shapefiles are probably the most accessible format there is. Every GIS
program on the planet reads and writes shapefiles. The shapefile format
has other drawbacks, but accessibility isn't one of them.
Cheers,
Micha
> thanks,
> --dick peskin
>
>
>
>
>
More information about the grass-user
mailing list