Shapfiles and Projections

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Shapfiles and Projections

Kent Eschenberg
gdrinfo doesn't seem to find a projection in a shapefile describiing roads
(from the National Atlas). I was expecting something like what gdalinfo finds
in a geotiff file. Could someone point me towards the answer? Thanks!

Kent
Pittsburgh Supercomputing Center
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

RE: Shapfiles and Projections

Martin Chapman-2
Kent,

Make sure there is a .prj file with the same name as the .shp file.  NTAD
data doesn't always come with these projection files.  If you read the .txt
file with the shape file it will tell you what datum it is using.  Attached
is a wgs84 prj file that should work if you rename it to be the same as your
.shp file.  NTAD is generally in WGS84.

Martin Chapman
Chief Software Architect
Fortified Datacom Inc.
http://www.fortifieddatacom.com
[hidden email]
303-324-1065

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Kent Eschenberg
Sent: Thursday, October 04, 2007 3:04 PM
To: GDAL
Subject: [Gdal-dev] Shapfiles and Projections

gdrinfo doesn't seem to find a projection in a shapefile describiing roads
(from the National Atlas). I was expecting something like what gdalinfo
finds
in a geotiff file. Could someone point me towards the answer? Thanks!

Kent
Pittsburgh Supercomputing Center
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev

milbase.prj (148 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Shapfiles and Projections

Ed McNierney-4
In reply to this post by Kent Eschenberg
Kent -

Unfortunately, the concept of projections and coordinate systems in general was late in coming to the shapefile format, and many (if not most) shapefiles have no projection/coordinate information with them.

Your shapefile should have a .txt file with it (presumably roadtrl20.txt if you're using the roads layer from the National Atlas) and it will contain this information:

Spatial_Reference_Information:
  Horizontal_Coordinate_System_Definition:
    Geographic:
      Latitude_Resolution: 0.000278
      Longitude_Resolution: 0.000278
      Geographic_Coordinate_Units: Decimal degrees
    Geodetic_Model:
      Horizontal_Datum_Name: North American Datum of 1983
      Ellipsoid_Name: GRS1980
      Semi-major_Axis: 6378137
      Denominator_of_Flattening_Ratio: 298.257222

As far as I am aware, all of the vector data available through the National Atlas site is in geographic coordinates (unprojected decimal degrees) on the NAD83 datum.

        - Ed

Ed McNierney
Chief Mapmaker
Demand Media / TopoZone.com
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: 978-251-4242, Fax: 978-251-1396
[hidden email]



-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Kent Eschenberg
Sent: Thursday, October 04, 2007 5:04 PM
To: GDAL
Subject: [Gdal-dev] Shapfiles and Projections

gdrinfo doesn't seem to find a projection in a shapefile describiing roads
(from the National Atlas). I was expecting something like what gdalinfo finds
in a geotiff file. Could someone point me towards the answer? Thanks!

Kent
Pittsburgh Supercomputing Center
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Shapfiles and Projections

Frank Warmerdam
In reply to this post by Kent Eschenberg
Kent Eschenberg wrote:
> gdrinfo doesn't seem to find a projection in a shapefile describiing
> roads (from the National Atlas). I was expecting something like what
> gdalinfo finds in a geotiff file. Could someone point me towards the
> answer? Thanks!

Kent,

I assume you were using ogrinfo?

It will report coordinate system info if it finds it.  Does your shapefile
dataset include a .prj file?   If not, there is not declared coordinate
system for the file.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Shapfiles and Projections

Kent Eschenberg
In reply to this post by Martin Chapman-2
Thank you all for your assistance. The gdal/ogr library can read the shapefile
if the directory also contains the dbf and shx files that came along with the
shp file. Specific responses below.

  -----Original Message-----
 > gdrinfo doesn't seem to find a projection in a shapefile describiing roads
 > (from the National Atlas). I was expecting something like what gdalinfo
 > finds in a geotiff file. Could someone point me towards the answer?

Martin Chapman wrote:
 > Make sure there is a .prj file with the same name as the .shp file.  NTAD
 > data doesn't always come with these projection files.  If you read the .txt
 > file with the shape file it will tell you what datum it is using.  Attached
 > is a wgs84 prj file that should work if you rename it to be the same as your
 > .shp file.  NTAD is generally in WGS84.

Hmmm ... I didn't do that; there is no prj file but it now seems to work.

Ed McNierney wrote:
 > Unfortunately, the concept of projections and coordinate systems in general
 > was late in coming to the shapefile format, and many (if not most)
 > shapefiles have no projection/coordinate information with them.
 >
 > Your shapefile should have a .txt file with it (presumably roadtrl20.txt
 > if you're using the roads layer from the National Atlas) and it will
 > contain this information:
<clip>

Yes, a txt file was supplied and it has information similar to your example.
However it doesn't seem to be used. I'm still developing my application and so
I'll find out soon enough if it is needed by hiding or not hiding the txt file.

Frank Warmerdam wrote:
 > I assume you were using ogrinfo?
 >
 > It will report coordinate system info if it finds it.  Does your shapefile
 > dataset include a .prj file?   If not, there is not declared coordinate
 > system for the file.

Yes, my mistake, I am using ogrinfo. No prj file was supplied but it seems that
information was provided in the txt file.

Kent
Pittsburgh Supercomputing Center
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

RE: Shapfiles and Projections

Ed McNierney-4
Kent -

Sorry - when I said that the projection information was in the .txt
file, I did not mean to imply (but I did) that it could be automatically
read from that location.  A "shapefile" is really 3 or more files -
file.shp, file.dbf, and file.shx - and you must have all three or it's
not a shapefile.  In addition, if you have file.prj containing the
projection definition then that will be read automatically - the .txt
file is not part of the shapefile suite and isn't recognized.

     - Ed


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Kent
Eschenberg
Sent: Tuesday, October 09, 2007 1:59 PM
To: [hidden email]
Subject: Re: [Gdal-dev] Shapfiles and Projections

Thank you all for your assistance. The gdal/ogr library can read the
shapefile
if the directory also contains the dbf and shx files that came along
with the
shp file. Specific responses below.

  -----Original Message-----
 > gdrinfo doesn't seem to find a projection in a shapefile describiing
roads
 > (from the National Atlas). I was expecting something like what
gdalinfo
 > finds in a geotiff file. Could someone point me towards the answer?

Martin Chapman wrote:
 > Make sure there is a .prj file with the same name as the .shp file.
NTAD
 > data doesn't always come with these projection files.  If you read
the .txt
 > file with the shape file it will tell you what datum it is using.
Attached
 > is a wgs84 prj file that should work if you rename it to be the same
as your
 > .shp file.  NTAD is generally in WGS84.

Hmmm ... I didn't do that; there is no prj file but it now seems to
work.

Ed McNierney wrote:
 > Unfortunately, the concept of projections and coordinate systems in
general
 > was late in coming to the shapefile format, and many (if not most)
 > shapefiles have no projection/coordinate information with them.
 >
 > Your shapefile should have a .txt file with it (presumably
roadtrl20.txt
 > if you're using the roads layer from the National Atlas) and it will
 > contain this information:
<clip>

Yes, a txt file was supplied and it has information similar to your
example.
However it doesn't seem to be used. I'm still developing my application
and so
I'll find out soon enough if it is needed by hiding or not hiding the
txt file.

Frank Warmerdam wrote:
 > I assume you were using ogrinfo?
 >
 > It will report coordinate system info if it finds it.  Does your
shapefile
 > dataset include a .prj file?   If not, there is not declared
coordinate
 > system for the file.

Yes, my mistake, I am using ogrinfo. No prj file was supplied but it
seems that
information was provided in the txt file.

Kent
Pittsburgh Supercomputing Center
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Shapfiles and Projections

Dean Mikkelsen
In reply to this post by Kent Eschenberg
Hi Kent,
 
The Shapefile technical definition can also be found here:
 
and
 
 
Note that the .prj is optional and was a late addition to the Shapefile definition (not sure myself when it came along, but it was not present in the Original White paper).
 
Cheers,
Dean

----- Original Message -----
From: Kent Eschenberg <[hidden email]>
Date: Tuesday, October 9, 2007 11:08 am
Subject: Re: [Gdal-dev] Shapfiles and Projections
To: [hidden email]

> Thank you all for your assistance. The gdal/ogr library can read
> the shapefile 
> if the directory also contains the dbf and shx files that came
> along with the
> shp file. Specific responses below.
>
>   -----Original Message-----
>  > gdrinfo doesn't seem to find a projection in a shapefile
> describiing roads
>  > (from the National Atlas). I was expecting something
> like what gdalinfo
>  > finds in a geotiff file. Could someone point me towards
> the answer?
>
> Martin Chapman wrote:
>  > Make sure there is a .prj file with the same name as the
> .shp file.  NTAD
>  > data doesn't always come with these projection
> files.  If you read the .txt
>  > file with the shape file it will tell you what datum it
> is using.  Attached
>  > is a wgs84 prj file that should work if you rename it to
> be the same as your
>  > .shp file.  NTAD is generally in WGS84.
>
> Hmmm ... I didn't do that; there is no prj file but it now seems
> to work.
>
> Ed McNierney wrote:
>  > Unfortunately, the concept of projections and coordinate
> systems in general
>  > was late in coming to the shapefile format, and many (if
> not most)
>  > shapefiles have no projection/coordinate information
> with them.
>  >
>  > Your shapefile should have a .txt file with it
> (presumably roadtrl20.txt
>  > if you're using the roads layer from the National Atlas)
> and it will
>  > contain this information:
> <clip>
>
> Yes, a txt file was supplied and it has information similar to
> your example.
> However it doesn't seem to be used. I'm still developing my
> application and so
> I'll find out soon enough if it is needed by hiding or not
> hiding the txt file.
>
> Frank Warmerdam wrote:
>  > I assume you were using ogrinfo?
>  >
>  > It will report coordinate system info if it finds
> it.  Does your shapefile
>  > dataset include a .prj file?   If not, there
> is not declared coordinate
>  > system for the file.
>
> Yes, my mistake, I am using ogrinfo. No prj file was supplied
> but it seems that
> information was provided in the txt file.
>
> Kent
> Pittsburgh Supercomputing Center
> _______________________________________________
> Gdal-dev mailing list
> [hidden email]
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>

Dean C. Mikkelsen, B.Sc., P.Eng.
Terra ETL Ltd.
Victoria, B.C., Canada
Phone: +1 (250) 361-6672
http://www.terraetl.com

Consulting in Geodesy & GIS  for the Natural Resources


_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Shapfiles and Projections

Dean Mikkelsen
Hi everyone,
 
The second link sometimes appears dead, but here is cut-and-paste from the document.
 
    • .shp- the file that stores the feature geometry. Required.
    • .shx- the file that stores the index of the feature geometry. Required.
    • .dbf- the dBASE file that stores the attribute information of features. Required.
    • .sbnand .sbx- the files that store the spatial index of the features. Optional. These two files can be created in ArcView. See ArcView's on-line help for more information.
    • .fbnand .fbx- the files that store the spatial index of the features for shapefiles that are read-only. Optional. These two files can be created in ArcView. See ArcView's on-line help for more information.
    • .ain and .aih - the files that store the attribute index of the active fields in a table or a theme's attribute table. Optional. These two files can be created in ArcView. See ArcView's on-line help for more information.
    • .prj - the file that stores the coordinate system information. Optional. This file can be created with and is used by the ArcView Projection Utility. It is not used by ArcView GIS Version 3.x or older versions, or by ARC/INFO versions previous to version 8.0.
    • .xml - metadata for ArcInfo 8.0, for using shapefiles on the Internet. Optional.
A good summary of the file types used by ESRI.
 
Cheers,
Dean
----- Original Message -----
From: Dean Mikkelsen <[hidden email]>
Date: Tuesday, October 9, 2007 11:43 am
Subject: Re: [Gdal-dev] Shapfiles and Projections
To: [hidden email]
Cc: [hidden email]

> Hi Kent,
>  
> The Shapefile technical definition can also be found here:
>  
> http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf
>
> and
>  
> http://facweb.knowlton.ohio-
> state.edu/selhami/crpinfo/teaching/CRP608/Shape%20file%20structure.doc 
> Note that the .prj is optional and was a late addition to the
> Shapefile definition (not sure myself when it came along, but it
> was not present in the Original White paper).
>  
> Cheers,
> Dean
>
> ----- Original Message -----
> From: Kent Eschenberg <[hidden email]>
> Date: Tuesday, October 9, 2007 11:08 am
> Subject: Re: [Gdal-dev] Shapfiles and Projections
> To: [hidden email]
>
> > Thank you all for your assistance. The gdal/ogr library can
> read
> > the shapefile
> > if the directory also contains the dbf and shx files that came
> > along with the
> > shp file. Specific responses below.
> >
> >   -----Original Message-----
> >  > gdrinfo doesn't seem to find a projection in a
> shapefile
> > describiing roads
> >  > (from the National Atlas). I was expecting something
> > like what gdalinfo
> >  > finds in a geotiff file. Could someone point me
> towards
> > the answer?
> >
> > Martin Chapman wrote:
> >  > Make sure there is a .prj file with the same name as
> the
> > .shp file.  NTAD
> >  > data doesn't always come with these projection
> > files.  If you read the .txt
> >  > file with the shape file it will tell you what datum
> it
> > is using.  Attached
> >  > is a wgs84 prj file that should work if you rename it
> to
> > be the same as your
> >  > .shp file.  NTAD is generally in WGS84.
> >
> > Hmmm ... I didn't do that; there is no prj file but it now
> seems
> > to work.
> >
> > Ed McNierney wrote:
> >  > Unfortunately, the concept of projections and
> coordinate
> > systems in general
> >  > was late in coming to the shapefile format, and many
> (if
> > not most)
> >  > shapefiles have no projection/coordinate information
> > with them.
> >  >
> >  > Your shapefile should have a .txt file with it
> > (presumably roadtrl20.txt
> >  > if you're using the roads layer from the National
> Atlas)
> > and it will
> >  > contain this information:
> > <clip>
> >
> > Yes, a txt file was supplied and it has information similar to
> > your example.
> > However it doesn't seem to be used. I'm still developing my
> > application and so
> > I'll find out soon enough if it is needed by hiding or not
> > hiding the txt file.
> >
> > Frank Warmerdam wrote:
> >  > I assume you were using ogrinfo?
> >  >
> >  > It will report coordinate system info if it finds
> > it.  Does your shapefile
> >  > dataset include a .prj file?   If not, there
> > is not declared coordinate
> >  > system for the file.
> >
> > Yes, my mistake, I am using ogrinfo. No prj file was supplied
> > but it seems that
> > information was provided in the txt file.
> >
> > Kent
> > Pittsburgh Supercomputing Center
> > _______________________________________________
> > Gdal-dev mailing list
> > [hidden email]
> > http://lists.maptools.org/mailman/listinfo/gdal-dev
> >
>
> Dean C. Mikkelsen, B.Sc., P.Eng.
> Terra ETL Ltd.
> Victoria, B.C., Canada
> Phone: +1 (250) 361-6672
> http://www.terraetl.com
>
> Consulting in Geodesy & GIS  for the Natural Resources
>

Dean C. Mikkelsen, B.Sc., P.Eng.
Terra ETL Ltd.
Victoria, B.C., Canada
Phone: +1 (250) 361-6672
http://www.terraetl.com

Consulting in Geodesy & GIS  for the Natural Resources


_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Shapfiles and Projections

mhw-at-yg
Dean Mikkelsen wrote:
> Hi everyone,
>  
> The second link sometimes appears dead, but here is cut-and-paste from
> the document.

There are some new optional additions described here
http://tinyurl.com/ypsgn4. The additions are:

* .atx — An .atx file is created for each shapefile or dBASE attribute
index created in ArcCatalog. ArcView GIS 3.x attribute indexes for
shapefiles and dBASE files are not used by ArcGIS. A new attribute
indexing model has been developed for shapefiles and dBASE files.

* .ixs — Geocoding index for read-write shapefiles.

* .mxs — Geocoding index for read-write shapefiles (ODB format).

I've not seen the format of these extra files defined or specified
anywhere though I first heard about them in 2001.

Thanks to the prompting of this thread I've put together a summary of
the extensions at http://trac.osgeo.org/gdal/wiki/UserDocs/Shapefiles

cheers,


--
matt wilkie
--------------------------------------------
Geographic Information,
Information Management and Technology,
Yukon Department of Environment
10 Burns Road * Whitehorse, Yukon * Y1A 4Y9
867-667-8133 Tel * 867-393-7003 Fax
http://environmentyukon.gov.yk.ca/geomatics/
--------------------------------------------

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev
-Matt