[Mapserver-users] Determining Shapefile EXTENT
Tyler Mitchell
TMitchell at lignum.com
Tue Oct 7 08:26:16 PDT 2003
Edward,
I would highly recommend the "ogr" utility called "ogrinfo". You can
read more about it here:
http://gdal.velocet.ca/projects/opengis/
and see examples here:
http://gdal.velocet.ca/projects/opengis/ogrhtml/ogr_utilities.html
You can basically run ogrinfo against a shapefile and get all the details
you want (and more).
It runs like:
>ogrinfo c:\path\to\folder\
which will give you a list of the "layers" in the folder. This will
include all the shape files you have.
Then you can request info for a particular layer/shape file like this:
>ogrinfo c:\path\to\folder\ <layername>
i.e ogrinfo c:\tmp\shapefiles cities
And you will get a listing of all the fields, their values and the
geometries for each shape.
Note, using " | more " or " | head " to the end of the command (if
available) will save you from viewing all the details which you may not
want :)
If you are interested in just getting extents, then I use "grep" (I can
provide pointers to that utility if needed) to only give me the extent
information.
> ogrinfo c:\tmp\shapefiles cities | grep Extent
If you need more info, let us know. OGR and it's mother project GDAL are
an integral part of a robust Mapserver installation and used by many on
this list.
Tyler
mapserver-users-admin at lists.gis.umn.edu wrote on 10/07/2003 07:57:49 AM:
> From: MS Newbie
> I have managed to download some shapefiles, when I try to load a
> mapfile, I get a blank image. For one, I don't know which EXTENT to
> use and again I don't have ArcView (can't afford) to determine the
> shapefile's Extent. Is there another way of determining the extent
> of a shapefile without ArcView? The shapefiles I have downloaded
> come with Word Docs describing the data a little bit e.g
>
>
----------------------------------------------------------------------------------
> Additional attribute information
> Shape: Internally generated by Arc/infoArea
> Internally generated by Arc/info
> Perimeter: Internally generated by Arc/info
> Town_name: Name of the town represented by the points
> Unique identification for each town class. The towns have been
> classified into 6 categories namely:
> (1) Municipality (2) Township/Town (3) Trading center (4) Market center
> (6) Lodges/camps (11) City
> Town type: Class in which the particular towns fall
> Layer Characteristics
> Projection: Geographic
> Theme: Administrative
> Layer type: Arc View shape
> Feature type: Point
>
----------------------------------------------------------------------------------------------------
> Can anyone translate this for me? (atleast 'point' I can use e.g
> TYPE POINT in the mapfile ...)
> Thank you,
> Edward.
>
> [image removed]
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
More information about the MapServer-users
mailing list