[Gvsig_desarrolladores] Error en la edición de geometrías?
junquero
ijunquero en uoc.edu
Mie Abr 18 17:41:15 CEST 2012
Hola
He seguido avanzando en el estudio del problema, y he encontrado que en la
clase WKTParser.java, hay un método
private Geometry readLineStringText(StreamTokenizer tokenizer)
Entiendo que esta clase debería crear una geometría compatible con
LineString, y sin embargo, crea una geometría Surface.
He cambiado el código para que genere una geometría tipo Curve en lugar de
Surface y ahora si que me funciona correctamente.
La cuestión es: ¿porqué se está creando una geometría tipo Surface en lugar
de Curve? ¿Cambiar a Curve tendrá efectos colaterales?
/**
* Creates a <code>LineString</code> using the next token in the
stream.
*
*@param tokenizer tokenizer over a stream of text in
Well-known Text
* format. The next tokens must form a <LineString Text>.
*@return a <code>LineString</code> specified by the
next
* token in the stream
*@throws IOException if an I/O error occurs
*@throws ParseException if an unexpected token was encountered
* @throws CreateGeometryException
* @throws IllegalAccessException
* @throws InstantiationException
*/
private Geometry readLineStringText(StreamTokenizer tokenizer) throws
IOException, ParseException, CreateGeometryException {
Coordinate[] arrayC = getCoordinates(tokenizer);
GeneralPathX gp = new GeneralPathX();
gp.moveTo(arrayC[0].x,arrayC[0].y);
for (int i=1;i < arrayC.length; i++)
{
gp.lineTo(arrayC[i].x, arrayC[i].y);
}
* // IJM: Cambiado Surface por Curve
Curve curve = (Curve) manager.create(TYPES.CURVE,
SUBTYPES.GEOM2D);
curve.setGeneralPath(gp);
return curve;
* }
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Error-en-la-edicion-de-geometrias-tp4889279p4894707.html
Sent from the gvSIG desarrolladores mailing list archive at Nabble.com.
Más información sobre la lista de distribución gvSIG_desarrolladores