If you can provide runnable Java test code that will make it easier to help.


On Thu, Jun 20, 2013 at 3:23 PM, SK <[email protected]> wrote:

> Hi,
> I have simple test data
> //[[(x, y, (sin x -sin y)*10)| x <- [-6..6]] | y <- [-3..3]]
> static String sinXminusSinY = "MULTIPOINT ("
>   + "  (-6.0 -3.0 4.205355062587931 ),"
>  + "(-5.0 -3.0 11.000442827230057 ),"
>  + "(-4.0 -3.0 8.979225033677954 ),"
>  + "(-3.0 -3.0 0.0 ),"
>  + "(-2.0 -3.0 -7.681774187658145 ),"
>  + "(-1.0 -3.0 -7.003509767480293 ),"
>  + "(0.0 -3.0 1.4112000805986722 ),"
>  + "(1.0 -3.0 9.825909928677637 ),"
>  + "(2.0 -3.0 10.50417434885549 ),"
>  + "(3.0 -3.0 2.8224001611973444 ),"
>  + "(4.0 -3.0 -6.15682487248061 ),"
>  + "(5.0 -3.0 -8.178042666032713 ),"
>  + "(6.0 -3.0 -1.3829549013905864) ," etc
>
> Next I triangulate this and get subdivision
>
> QuadEdgeSubdivision subdiv = builder.getSubdivision();
>
> Now I need to fill an array [-6, 6]x[-3, 3]
>
> and I try to interpolate my data in cycle
> double val = interpolateZ(subdiv, new Coordinate(myX, myY));
>
> //(I found this on Stackoverflow)
> public static double interpolateZ(QuadEdgeSubdivision quadEdgeSubdivision,
> Coordinate coordinate) {
>         QuadEdge edge = quadEdgeSubdivision.locate(coordinate);
>         System.out.println(edge.toString());///!!!See below
>         return new Vertex(coordinate.x,
> coordinate.y).interpolateZValue(edge.orig(), edge.dest(),
> edge.oNext().dest());
>     }
>
> But I have a NaN processing column of my sample data.
> When I print edge I get strange result.  I have no any 126, 123 in my
> programm.
> LINESTRING ( -126.0 -123.0, -6.0 -3.0 )
> LINESTRING ( -126.0 -123.0, -6.0 -2.0 )
> LINESTRING ( -126.0 -123.0, -6.0 -1.0 )
> LINESTRING ( -126.0 -123.0, -6.0 0.0 )
> LINESTRING ( -126.0 -123.0, -6.0 1.0 )
> LINESTRING ( -126.0 -123.0, -6.0 2.0 )
> LINESTRING ( -126.0 -123.0, -6.0 3.0 )
>
> Is it normal or I did something wrong?
> Thank you
> CK
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> Jts-topo-suite-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user
>
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user

Reply via email to