Geotools people,
I know I have not been the most responsive module maintainer in the
history of this project, but can we at least update Jira to assign new
data-VPF issues to me?  I didn't even know about GEOT-2094 until I was
contacted directly by the person who was trying it.
Meanwhile, in what branch should I be making these changes?  If my
commit rights still work, I will be happy to make the changes.
Regards,
Jeff


________________________________

From: Jeff Yutzler 
Sent: Thursday, February 19, 2009 1:30 PM
To: 'Malm Paul'
Subject: RE: VPF question


Paul,
In VPFColumn.java, around line 205, there is an isGeometry method, but
the check is wrong.  It should be: 
return attribute instanceof GeometryDescriptor;
Also, don't forget to import:
import org.opengis.feature.type.GeometryDescriptor;

This should give you actual Geometry columns that you can work with.
Regards,
Jeff

________________________________

From: Jeff Yutzler 
Sent: Thursday, February 05, 2009 5:19 PM
To: Malm Paul
Subject: RE: VPF question


Paul,
I haven't forgotten about you, but unfortunately I'm really strapped for
time right now and I don't expect for the situation to improve for at
least another week.  I suggest taking a look at the isGeometry method.
Hopefully something there will make some sense.
Regards,
-Jeff

________________________________

From: Jeff Yutzler [mailto:[email protected]] 
Sent: den 20 januari 2009 14:48
To: Malm Paul
Subject: RE: VPF question


Okay, I'm sorry that didn't work.  I won't be able to take a full look
at this until Thursday at the earliest.  The first place I'm going to
look is the isGeometry method.  This worked at one time, but I guess
there was a regression of some sort.
Regards,
-Jeff

________________________________

From: Malm Paul [mailto:[email protected]] 
Sent: Tuesday, January 20, 2009 4:55 AM
To: Jeff Yutzler
Subject: RE: VPF question


Mr. Yutzler,
Thank you for the answer!
 
I inserted a check if "gat" is not null in VPFFile() 
if (gat != null)
    b.setDefaultGeometry(gat.getLocalName());

Then the nullPointerException dissappered but it did not find any
Geometry columns at all in any of the files.

Then I had to do the same in VPFFeatureClass.java :

 if (gat != null)
    b.setDefaultGeometry(gat.getLocalName());

and of course, no geometry colums were found there either.

What I want to do is to read a VPF map and convert it to another format,
thats all.

Kind regards,
Paul Malm 


________________________________

From: Jeff Yutzler [mailto:[email protected]] 
Sent: den 19 januari 2009 21:24
To: Malm Paul
Cc: [email protected]
Subject: RE: VPF question


Mr. Malm,
The code in question does not look like mine.  It would be
uncharacteristic for me to name a SimpleFeatureTypeBuilder "b".  My
guess is that some refactoring work was done after I stopped working on
the project  (I did my work about 4 years ago) and that this work
assumes that the "gat" will be populated.  If I recall correctly, some
VPF "feature types" don't actually have geometries so this is an unsafe
assumption.  My suggestion is simply to place a sanity check around the
call to setDefaultGeometry and to proceed from there.
If this doesn't work (the "gat" is NEVER populated), please let me know
and I will try to investigate further.
Regards,
Jeff

________________________________

From: Malm Paul [mailto:[email protected]] 
Sent: Monday, January 19, 2009 7:23 AM
To: Jeff Yutzler
Subject: VPF question


Hi Jeff!
I have tried to mail the user group without any luck, therefore I'm
trying with you directly.
If you have the time to point me in the right direction I would be very
gratefull !
I don't know anything about the VPF - format.
 
I've downloaded geoTools 2.5.2 because I saw that it was possible to
read VPF files with tis tool kit.
Indata = eurnasia downloaded from NGA.
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:13
5)
        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 !
 
Kind Regards,
 
Paul Malm
 
 
------------------------------------------------------------------------------
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

Reply via email to