From: Combe, C. <C....@na...> - 2003-08-27 23:18:32
|
sorry, that "thing" I mentioned at the end of my last mail is obviously called a RenderedMapScale, col -----Original Message----- From: Combe, Colin To: 'geo...@li...' Sent: 8/27/03 9:57 PM Subject: [Geotools-gt2-users] polygons with holes in them Hi,=20 I'm making progress with gt2 but am having problems displaying polygons with holes in them. For example, if I load the following gml data into MapViewer2 (edited to take a GMLDataSource): =20 <gml:featureCollection xmlns:gml=3D"http://www.opengis.net/gml">=20 <gml:FeatureMember>=20 <gml:Polygon>=20 <gml:outerBoundaryIs>=20 <gml:LinearRing>=20 <gml:coordinates decimal=3D"." cs=3D"," ts=3D" ">=20 0.0,0.0 100.0,0.0 100.0,100.0 0.0,100.0 0.0,0.0=20 </gml:coordinates>=20 </gml:LinearRing>=20 </gml:outerBoundaryIs>=20 <gml:innerBoundaryIs>=20 <gml:LinearRing>=20 <gml:coordinates decimal=3D"." cs=3D"," ts=3D" ">=20 10.0,10.0 10.0,40.0 40.0,40.0 40.0,10.0 10.0,10.0=20 </gml:coordinates>=20 </gml:LinearRing>=20 </gml:innerBoundaryIs>=20 </gml:Polygon>=20 </gml:FeatureMember>=20 </gml:featureCollection>=20 I thought I should see a polygon with a hole in it, but both the = squares are filled in. I can't seem to find anything in the documentation about enabling clipping or anything, but i noticed that PolygonTest.java for the renderer package does display such a polygon.=20 There's a couple of other things that are confusing me. When I read in my shapfiles there were problems (ArithmeticException: No convergence for points * and *) with some points in lineStrings. I worked round this by outputing the files as GML and then commenting out the offending = points. After a quick look at the source code, i was confused about how 2 = points could be non-equal but it not to be possible to calculate the distance between them, i couldn't see how it could reach the line that throws = the exception (org.geotools.cs.Ellipsoid.orthodromicDistance (Ellipsoid.java:382)). For example, if the commenting is removed from: <gml:LineString>=20 <gml:coordinates decimal=3D"." cs=3D"," ts=3D" ">=20 330000,674826 330134,674686 330154,674668 <!--330176,674640--> 330358,674457 330410,674389 =20 </gml:coordinates>=20 </gml:LineString>=20 it causes the error: No convergence for points 330176=B000.0'E 674640=B000.0'N and 330358=B000.0'E 674457=B000.0'N. I guess this is some subtlety to = do with map projections that i don't know about... The other thing thats confusing me is the scale bar down in the bottom left of MapViewer2. Its a nice feature but its readings are wrong and don't seem to change in a sensible way as you zoom in and out. I expect this is probably because it not finished but I can't find anything in the docs about what this thing is called or how to control it.=20 I couldn't get MapViewer to work (just displays a blank canvas/map = pane) but i'm well impressed by MapViewer2 - IMHO its nicer than the demos that come with ESRI's Java Map Objects (the evaluation copy of it anyway).=20 thanks for your help - and the huge amount of work thats gone into this toolkit :)=20 colin=20 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Geotools-gt2-users mailing list Geo...@li... https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users |