Revision 11704 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FConverter.java
FConverter.java | ||
---|---|---|
290 | 290 |
shells.add(ring); |
291 | 291 |
} |
292 | 292 |
} catch (Exception e) { |
293 |
/* (jaume) caso cuando todos los puntos son iguales |
|
294 |
* devuelvo el propio punto |
|
295 |
*/ |
|
296 |
boolean same = true; |
|
297 |
for (int i = 0; i < points.length-1 && same; i++) { |
|
298 |
if (points[i].x != points[i+1].x || |
|
299 |
points[i].y != points[i+1].y /*|| |
|
300 |
points[i].z != points[i+1].z*/ |
|
301 |
) same = false; |
|
302 |
} |
|
303 |
if (same) |
|
304 |
return geomFactory.createPoint(points[0]); |
|
305 |
/* |
|
306 |
* caso cuando es una l?nea de 3 puntos, no creo un LinearRing, sino |
|
307 |
* una linea |
|
308 |
*/ |
|
309 |
if (points.length>1 && points.length<=3) |
|
310 |
// return geomFactory.createLineString(points); |
|
311 |
return geomFactory.createMultiLineString(new LineString[] {geomFactory.createLineString(points)}); |
|
312 |
|
|
293 | 313 |
System.err.println( |
294 | 314 |
"Caught Topology exception in GMLLinearRingHandler"); |
295 | 315 |
|
... | ... | |
360 | 380 |
shells.add(ring); |
361 | 381 |
} |
362 | 382 |
} catch (Exception e) { |
383 |
/* (jaume) caso cuando todos los puntos son iguales |
|
384 |
* devuelvo el propio punto |
|
385 |
*/ |
|
386 |
boolean same = true; |
|
387 |
for (int i = 0; i < points.length-1 && same; i++) { |
|
388 |
if (points[i].x != points[i+1].x || |
|
389 |
points[i].y != points[i+1].y /*|| |
|
390 |
points[i].z != points[i+1].z*/ |
|
391 |
) same = false; |
|
392 |
} |
|
393 |
if (same) |
|
394 |
return geomFactory.createPoint(points[0]); |
|
395 |
/* |
|
396 |
* caso cuando es una l?nea de 3 puntos, no creo un LinearRing, sino |
|
397 |
* una linea |
|
398 |
*/ |
|
399 |
if (points.length>1 && points.length<=3) |
|
400 |
// return geomFactory.createLineString(points); |
|
401 |
return geomFactory.createMultiLineString(new LineString[] {geomFactory.createLineString(points)}); |
|
363 | 402 |
System.err.println( |
364 | 403 |
"Caught Topology exception in GMLLinearRingHandler"); |
365 | 404 |
|
Also available in: Unified diff