[Geoserver-users] shapefile .prj has extra spaces that confuse ArcMap 9.2 SP1

Something I discovered while trying to extract a shapefile from GeoServer 1.5:

This request:
http://64.119.128.70/geoserver/wfs?request=GetFeature&service=wfs&version=1.1.1&typename=massgis:GISDATA.TOWNS_POLY&outputformat=SHAPE-ZIP

produces a shapefile with a .prj with these contents:

PROJCS[“NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001”,
GEOGCS[“GCS_North_American_1983”,
DATUM[“D_North_American_1983”,
SPHEROID[“GRS_1980”, 6378137.0, 298.257222101]],
PRIMEM[“Greenwich”, 0.0],
UNIT[“degree”, 0.017453292519943295],
AXIS[“Lon”, EAST],
AXIS[“Lat”, NORTH]],
PROJECTION[“Lambert_Conformal_Conic”],
PARAMETER[“central_meridian”, -71.5],
PARAMETER[“latitude_of_origin”, 41.0],
PARAMETER[“standard_parallel_1”, 41.71666666666667],
PARAMETER[“scale_factor”, 1.0],
PARAMETER[“false_easting”, 200000.0],
PARAMETER[“false_northing”, 750000.0],
PARAMETER[“standard_parallel_2”, 42.68333333333334],
UNIT[“m”, 1.0],
AXIS[“x”, EAST],
AXIS[“y”, NORTH]]

A prj of the same layer exported from SDE to a shapefile has these contents:

PROJCS[“NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001”,GEOGCS[“GCS_North_American_1983”,DATUM[“D_North_American_1983”,SPHEROID[“GRS_1980”,6378137.0,298.257222101]],PRIMEM[“Greenwich”,0.0],UNIT[“Degree”,0.0174532925199433]],PROJECTION[“Lambert_Conformal_Conic”],PARAMETER[“False_Easting”,200000.0],PARAMETER[“False_Northing”,750000.0],PARAMETER[“Central_Meridian”,-71.5],PARAMETER[“Standard_Parallel_1”,41.71666666666667],PARAMETER[“Standard_Parallel_2”,42.68333333333333],PARAMETER[“Latitude_Of_Origin”,41.0],UNIT[“Meter”,1.0]]

The shapefile extracted from GeoServer when added to ArcMap generates a warning about the projection and the coordinate system is undefined when the properties of the layer are looked at. (It does draw though). I fiddled with the .prj of the version extracted from GeoServer and kept loading it into ArcMap and found that changing the slight differences (“m” versus “meter” or the order of things) didn’t make the .prj recognizable to ArcMap. What mattered was getting rid of all the hard returns.

So the version from GeoServer then becomes:

PROJCS[“NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001”,GEOGCS[“GCS_North_American_1983”,DATUM[“D_North_American_1983”,SPHEROID[“GRS_1980”, 6378137.0, 298.257222101]],PRIMEM[“Greenwich”, 0.0],UNIT[“degree”, 0.017453292519943295],AXIS[“Lon”, EAST],AXIS[“Lat”, NORTH]],PROJECTION[“Lambert_Conformal_Conic”],PARAMETER[“central_meridian”, -71.5],PARAMETER[“latitude_of_origin”, 41.0],PARAMETER[“standard_parallel_1”, 41.71666666666667],PARAMETER[“scale_factor”, 1.0],PARAMETER[“false_easting”, 200000.0],PARAMETER[“false_northing”, 750000.0],PARAMETER[“standard_parallel_2”, 42.68333333333334],UNIT[“m”, 1.0],AXIS[“x”, EAST],AXIS[“y”, NORTH]]

which is not identical to the one from SDE, but ArcMap can read it. The GeoServer shapefile draws over the SDE layer.
This document from ESRI which describes how to create a .prj http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=14056 says that the string should be continuous.

Also, the “m” in UNIT should I think be “meter”, because when it is “m”, the measure tool in ArcMap says “unknown units” (it says “meters” when the .prj has “meter”)

Thanks for catching this Aleda. I will file a bug report and make sure that the .prj file is formatted without spaces.
I will look into the issue with the units being 'm' and not 'meter'. If it doesn't break any other tools or go against a standard, than I think we can go ahead and change how it outputs units.

Brent Owens
(The Open Planning Project)

Freeman, Aleda (ENV) wrote:

Something I discovered while trying to extract a shapefile from GeoServer 1.5:

This request:
_http://64.119.128.70/geoserver/wfs?request=GetFeature&service=wfs&version=1.1.1&typename=massgis:GISDATA.TOWNS_POLY&outputformat=SHAPE-ZIP_ <http://64.119.128.70/geoserver/wfs?request=GetFeature&service=wfs&version=1.1.1&typename=massgis:GISDATA.TOWNS_POLY&outputformat=SHAPE-ZIP&gt;

produces a shapefile with a .prj with these contents:

PROJCS["NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001",
  GEOGCS["GCS_North_American_1983",
    DATUM["D_North_American_1983",
      SPHEROID["GRS_1980", 6378137.0, 298.257222101]],
    PRIMEM["Greenwich", 0.0],
    UNIT["degree", 0.017453292519943295],
    AXIS["Lon", EAST],
    AXIS["Lat", NORTH]],
  PROJECTION["Lambert_Conformal_Conic"],
  PARAMETER["central_meridian", -71.5],
  PARAMETER["latitude_of_origin", 41.0],
  PARAMETER["standard_parallel_1", 41.71666666666667],
  PARAMETER["scale_factor", 1.0],
  PARAMETER["false_easting", 200000.0],
  PARAMETER["false_northing", 750000.0],
  PARAMETER["standard_parallel_2", 42.68333333333334],
  UNIT["m", 1.0],
  AXIS["x", EAST],
  AXIS["y", NORTH]]

A prj of the same layer exported from SDE to a shapefile has these contents:

PROJCS["NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",200000.0],PARAMETER["False_Northing",750000.0],PARAMETER["Central_Meridian",-71.5],PARAMETER["Standard_Parallel_1",41.71666666666667],PARAMETER["Standard_Parallel_2",42.68333333333333],PARAMETER["Latitude_Of_Origin",41.0],UNIT["Meter",1.0]]

The shapefile extracted from GeoServer when added to ArcMap generates a warning about the projection and the coordinate system is undefined when the properties of the layer are looked at. (It does draw though). I fiddled with the .prj of the version extracted from GeoServer and kept loading it into ArcMap and found that changing the slight differences ("m" versus "meter" or the order of things) didn't make the .prj recognizable to ArcMap. What mattered was getting rid of all the hard returns.

So the version from GeoServer then becomes:

PROJCS["NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980", 6378137.0, 298.257222101]],PRIMEM["Greenwich", 0.0],UNIT["degree", 0.017453292519943295],AXIS["Lon", EAST],AXIS["Lat", NORTH]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["central_meridian", -71.5],PARAMETER["latitude_of_origin", 41.0],PARAMETER["standard_parallel_1", 41.71666666666667],PARAMETER["scale_factor", 1.0],PARAMETER["false_easting", 200000.0],PARAMETER["false_northing", 750000.0],PARAMETER["standard_parallel_2", 42.68333333333334],UNIT["m", 1.0],AXIS["x", EAST],AXIS["y", NORTH]]

which is not identical to the one from SDE, but ArcMap can read it. The GeoServer shapefile draws over the SDE layer.
This document from ESRI which describes how to create a .prj _http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=14056_ <http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=14056&gt; says that the string should be continuous.

Also, the "m" in UNIT should I think be "meter", because when it is "m", the measure tool in ArcMap says "unknown units" (it says "meters" when the .prj has "meter")

------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users