Revision 19992 trunk/libraries/libTopology/src-test/org/gvsig/topology/util/LayerFactory.java
LayerFactory.java | ||
---|---|---|
459 | 459 |
null); |
460 | 460 |
} |
461 | 461 |
|
462 |
|
|
463 |
public static FLyrVect[] createPolygonForMustNotOverlapWithTest() throws ParseException{ |
|
464 |
|
|
465 |
FLyrVect[] solution = new FLyrVect[2]; |
|
466 |
|
|
467 |
LayerDefinition definition = createTestLayerDefinition(); |
|
468 |
definition.setShapeType(FShape.POLYGON); |
|
469 |
|
|
470 |
FeatureCollectionMemoryDriver driver = null; |
|
471 |
List<IFeature> features = new ArrayList<IFeature>(); |
|
472 |
int index = 0; |
|
473 |
|
|
474 |
|
|
475 |
Geometry poly1 = wktReader.read("POLYGON ((290 340, 180 280, 610 230, 720 330, 530 400, 300 380, 290 340))"); |
|
476 |
IFeature f1 = createTestFeature(poly1, index++); |
|
477 |
features.add(f1); |
|
478 |
|
|
479 |
Geometry poly3 = wktReader.read("POLYGON ((820 180, 820 30, 980 30, 1000 180, 820 180))"); |
|
480 |
IFeature f3 = createTestFeature(poly3, index++); |
|
481 |
features.add(f3); |
|
482 |
driver = new FeatureCollectionMemoryDriver("poligonos 1", |
|
483 |
features, |
|
484 |
definition); |
|
485 |
|
|
486 |
solution[0] = (FLyrVect) com.iver.cit.gvsig.fmap.layers.LayerFactory. |
|
487 |
createLayer("poligonos que solapan", |
|
488 |
driver, |
|
489 |
null); |
|
490 |
|
|
491 |
|
|
492 |
|
|
493 |
FeatureCollectionMemoryDriver driver2 = null; |
|
494 |
ArrayList<IFeature> features2 = new ArrayList<IFeature>(); |
|
495 |
index = 0; |
|
496 |
Geometry poly11= wktReader.read("POLYGON ((20 210, 30 50, 320 30, 330 180, 20 210))"); |
|
497 |
IFeature f11 = createTestFeature(poly11, index++); |
|
498 |
features2.add(f11); |
|
499 |
|
|
500 |
Geometry poly22= wktReader.read("POLYGON ((880 380, 920 230, 1000 210, 840 10, 880 380))"); |
|
501 |
IFeature f22 = createTestFeature(poly22, index++); |
|
502 |
features.add(f22); |
|
503 |
driver2 = new FeatureCollectionMemoryDriver("poligonos 1", |
|
504 |
features2, |
|
505 |
definition); |
|
506 |
|
|
507 |
solution[1] = (FLyrVect) com.iver.cit.gvsig.fmap.layers.LayerFactory. |
|
508 |
createLayer("poligonos que solapan", |
|
509 |
driver2, |
|
510 |
null); |
|
511 |
|
|
512 |
return solution; |
|
513 |
} |
|
514 |
|
|
462 | 515 |
private static LayerDefinition createTestLayerDefinition() { |
463 | 516 |
FieldDescription fieldDescription = new FieldDescription(); |
464 | 517 |
fieldDescription.setFieldName("str1"); |
Also available in: Unified diff