The term "Shapefile" does not refer just to the .SHP file, but also to all
the other files with the same name (.dbf, .prj. etc). These files should
always be operated on as a group.



On Tue, Feb 25, 2014 at 2:32 PM, Thomas Evans <[email protected]>wrote:

> Hi List,
>
> This is my first experience with GISData and GeoTools.  I am trying to use
> the ShapefileDataStore(URL url) to load up a handful of shape files into my
> Geography.  The schema and AttributeType of the GeometryTypeImpl that are
> created during the ShapefileDataStore construction both contain a null CRS.
>  I believe this info is usually loaded from the .prj file that is located
> in the same directory with the same filename of the .shp file.  Does anyone
> know of any gotchas here?
>
> Code -
> URL url = data.getFile().toURI().toURL();
> ShapefileDataStore store = new ShapefileDataStore(url);
> SimpleFeatureType schema = store.getSchema(store.getTypeNames()[0]);
> // First attribute at index 0 is always the Geometry
> AttributeType type = schema.getType(0);
> CoordinateReferenceSystem dataCRS = ((GeometryType)
> type).getCoordinateReferenceSystem(); <-- Returns null
>
> schema.toString() -
> SimpleFeatureTypeImpl
> http://www.opengis.net/gml:SoCALbg2010_TRTP_Extent_DATA_NUMBERSidentified 
> extends
> polygonFeature(the_geom:MultiPolygon,OBJECTID:OBJECTID,GEOID10:GEOID10,Shape_Leng:Shape_Leng,Shape_Area:Shape_Area,STATEP10_N:STATEP10_N,COUNTRYFP1:COUNTRYFP1,TRACTCE10_:TRACTCE10_,BLKGRPCE10:BLKGRPCE10,GEOID10_NO:GEOID10_NO,INTPLAT10_:INTPLAT10_,INTPLTON10:INTPLTON10,BLKGRP_NAM:BLKGRP_NAM,POP_TOTAL_:POP_TOTAL_,HHI_MEDIAN:HHI_MEDIAN,NOSCHOOL_N:NOSCHOOL_N,NOGED_NO:NOGED_NO,GED_NO:GED_NO,SOMEGOLLEG:SOMEGOLLEG,ASSOCIATE_:ASSOCIATE_,BACHELOR_N:BACHELOR_N,MASTER_NO:MASTER_NO,PROFESSION:PROFESSION,DOCTORATE_:DOCTORATE_,EDUCATION_:EDUCATION_,INCOME_NO:INCOME_NO,POWER_NO:POWER_NO,ALAND10_NO:ALAND10_NO,AWATER10_N:AWATER10_N,AREA_SQMI_:AREA_SQMI_,DENSITY_SQ:DENSITY_SQ)
>
> type.toString() -
> GeometryTypeImpl MultiPolygon<MultiPolygon>
>
> prj file content -
>
> PROJCS["World_Robinson",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Robinson"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],UNIT["Meter",1.0]]
>
>
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> _______________________________________________
> GeoTools-GT2-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to