DataStore can't identify geometry columns
-----------------------------------------
Key: GEOT-2347
URL: http://jira.codehaus.org/browse/GEOT-2347
Project: GeoTools
Issue Type: Bug
Components: data vpf
Affects Versions: 2.5.0
Reporter: Jeff Yutzler
Assignee: Jeff Yutzler
Priority: Critical
As reported from the field
{quote}
When I run the following command
DataStore ds = new org.geotools.data.vpf.VPFLibrary( new File
"C:\test\eurnasia\lib_007" ); // where the lht file is placed
I'm getting an exception;
Exception in thread "main" java.lang.NullPointerException
at org.geotools.data.vpf.file.VPFFile.<init>(VPFFile.java:171)
at
org.geotools.data.vpf.file.VPFFileStore.findFile(VPFFileStore.java:137)
at
org.geotools.data.vpf.file.VPFFileStore.getSchema(VPFFileStore.java:86)
at
org.geotools.data.vpf.file.VPFFileFactory.getFile(VPFFileFactory.java:135)
at org.geotools.data.vpf.VPFLibrary.<init>(VPFLibrary.java:171)
at org.geotools.data.vpf.VPFLibrary.<init>(VPFLibrary.java:156)
at VpfTest.main(VpfTest.java:22)
because of this function:
public VPFFile(String cPathName) throws IOException, SchemaException {
pathName = cPathName;
inputStream = new RandomAccessFile(cPathName, ACCESS_MODE);
readHeader();
GeometryDescriptor gat = null;
VPFColumn geometryColumn = null;
Iterator iter = columns.iterator();
while (iter.hasNext()) {
geometryColumn = (VPFColumn) iter.next();
if (geometryColumn.isGeometry()) {
gat = geometryColumn.getGeometryAttributeType();
break;
}
}
SimpleFeatureType superType = null;
// if it's a text geometry feature type add annotation as a super type
if (pathName.endsWith(TEXT_PRIMITIVE)) {
superType = AnnotationFeatureType.ANNOTATION;
}
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
b.setName( cPathName );
b.setNamespaceURI("VPF");
b.setSuperType(superType);
b.addAll( columns );
b.setDefaultGeometry(gat.getLocalName());
featureType = b.buildFeatureType();
}
gat is null when trying to get localName()
geometryColumn.isGeometry() is allways false !
{quote}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel