Hi,

 

I'm doing some dummy HelloWorld examples with GeoTools version 2.3.0,
but now I'm blocked.

 

I already created a Point with the GeometryFactory class, but when I
tried the LineString, I'm keep getting NullPointerException in the last
code line.

(The same problem has happen for the LinearRing object)

 

The code that I made is below:

 

import com.vividsolutions.jts.geom.Coordinate;

import com.vividsolutions.jts.geom.GeometryFactory;

import com.vividsolutions.jts.geom.LineString;

 

public class DummyHelloWorld {

 

      public static void main(String[] args) {

            GeometryFactory geometryFactory = null;

            Coordinate[] lineSegments = new Coordinate[5];

            

            lineSegments[0] = new Coordinate(5.0d,5.0d);

            lineSegments[1] = new Coordinate(6.0d,5.0d);

            lineSegments[2] = new Coordinate(6.0d,6.0d);

            lineSegments[3] = new Coordinate(7.0d,6.0d);

            lineSegments[4] = new Coordinate(7.0d,7.0d);

          

          LineString line =
geometryFactory.createLineString(lineSegments);

      }

}

 

Thanks in advance for any help,

Ricardo Pereira

 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to