Revision 9255
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.topology.lib.impl.TopologyImplLibrary |
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/en/LineMustBeLargerThanTolerance.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "LineMustBeLargerThanTolerance", |
|
3 |
"name": "Must Be Larger Than Tolerance", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/LineMustBeLargerThanTolerance.png\">\n", |
|
6 |
"Requires that a feature does not collapse during a validate process.\n", |
|
7 |
"This rule is mandatory for a topology and applies to all line feature classes.\n", |
|
8 |
"In instances where this rule is violated, the original geometry is left unchanged.\n" |
|
9 |
], |
|
10 |
"actions" : { |
|
11 |
"delete": { |
|
12 |
"name" : "Delete", |
|
13 |
"description": [ |
|
14 |
"Removes line features that would collapse during the validate", |
|
15 |
"process based on the topology's tolerance." |
|
16 |
] |
|
17 |
} |
|
18 |
} |
|
19 |
} |
|
20 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/en/PolygonMustNotOverlapWithPolygon.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PolygonMustNotOverlapWithPolygon", |
|
3 |
"name": "Must Not Overlap With", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/PolygonMustNotOverlapWithPolygon.png\">\n", |
|
6 |
"Requires that the interior of polygons in one feature class (or subtype) must not overlap with the interior of polygons in another feature class (or subtype). Polygons of the two feature classes can share edges or vertices or be completely disjointed. This rule is used when an area cannot belong to two separate feature classes. It is useful for combining two mutually exclusive systems of area classification, such as zoning and water body type, where areas defined within the zoning class cannot also be defined in the water body class and vice versa." |
|
7 |
], |
|
8 |
"actions" : { |
|
9 |
"Subtract": { |
|
10 |
"name" : "Subtract", |
|
11 |
"description": [ |
|
12 |
"The Subtract fix removes the overlapping portion of each feature that is causing the error and leaves a gap or void in its place. This fix can be applied to one or more selected Must Not Overlap With errors." |
|
13 |
] |
|
14 |
}, |
|
15 |
"Merge": { |
|
16 |
"name" : "Merge", |
|
17 |
"description": [ |
|
18 |
"The Merge fix adds the portion of overlap from one feature and subtracts it from the others that are violating the rule. You need to pick the feature that receives the portion of overlap using the Merge dialog box. This fix can be applied to one Must Not Overlap With error only." |
|
19 |
] |
|
20 |
} |
|
21 |
} |
|
22 |
} |
|
23 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/en/PolygonMustNotOverlapPolygon.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PolygonMustNotOverlapPolygon", |
|
3 |
"name": "Must Not Overlap", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/must_not_overlap.png\">\n", |
|
6 |
"Requires that the interior of polygons in the dataset not overlap.", |
|
7 |
"The polygons can share edges or vertices.", |
|
8 |
"This rule is used when an area cannot belong to two or more polygons.", |
|
9 |
"The polygons overlaps when the geometries have some points in common;", |
|
10 |
"but not all points in common (so if one geometry is inside the other", |
|
11 |
"overlaps would be false).", |
|
12 |
"The overlapping section must be the same kind of shape as the two geometries;", |
|
13 |
"so two polygons that touch on a point are not considered to be overlapping.", |
|
14 |
"It is useful for modeling administrative boundaries, such as ZIP Codes", |
|
15 |
"or voting districts, and mutually exclusive area classifications,", |
|
16 |
"such as land cover or landform type." |
|
17 |
], |
|
18 |
"actions" : { |
|
19 |
"CreateFeature": { |
|
20 |
"name" : "Create feature", |
|
21 |
"description": [ |
|
22 |
"The Create Feature fix creates a new polygon feature out of", |
|
23 |
"the error shape and removes the portion of overlap from each", |
|
24 |
"of the features, causing the error to create a planar", |
|
25 |
"representation of the feature geometry.\n", |
|
26 |
"This fix can be applied to one or more selected Must Not Overlap errors." |
|
27 |
] |
|
28 |
}, |
|
29 |
"Subtract": { |
|
30 |
"name" : "Subtract", |
|
31 |
"description": [ |
|
32 |
"The Subtract fix removes the overlapping portion of geometry", |
|
33 |
"from each feature that is causing the error and leaves a gap", |
|
34 |
"or void in its place. This fix can be applied to one or more", |
|
35 |
"selected Must Not Overlap errors." |
|
36 |
] |
|
37 |
}, |
|
38 |
"Merge": { |
|
39 |
"name" : "Merge", |
|
40 |
"description": [ |
|
41 |
"The Merge fix adds the portion of overlap from one feature", |
|
42 |
"and subtracts it from the others that are violating the rule.", |
|
43 |
"You need to pick the feature that receives the portion of", |
|
44 |
"overlap using the Merge dialog box.", |
|
45 |
"This fix can be applied to one Must Not Overlap error only." |
|
46 |
] |
|
47 |
} |
|
48 |
} |
|
49 |
} |
|
50 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/en/PolygonMustBeCoveredByPolygon.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PolygonMustBeCoveredByPolygon", |
|
3 |
"name": "Must Be Covered By", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/PolygonMustBeCoveredByPolygon.png\">\n", |
|
6 |
"Requires that polygons of one feature class (or subtype) must be contained within polygons of another feature class (or subtype). Polygons may share edges or vertices. Any area defined in the contained feature class must be covered by an area in the covering feature class. This rule is used when area features of a given type must be located within features of another type. This rule is useful when modeling areas that are subsets of a larger surrounding area, such as management units within forests or blocks within block groups." |
|
7 |
], |
|
8 |
"actions" : { |
|
9 |
"CreateFeature": { |
|
10 |
"name" : "Create feature", |
|
11 |
"description": [ |
|
12 |
"The Create Feature fix creates a new polygon feature out of the portion of overlap from the existing polygon so the boundary of each feature from both feature classes is the same. This fix can be applied to one or more selected Must Be Covered By errors." |
|
13 |
] |
|
14 |
} |
|
15 |
} |
|
16 |
} |
|
17 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/en/GeometryMustNotBeNull.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "GeometryMustNotBeNull", |
|
3 |
"name": "Geometry must not be null", |
|
4 |
"description": [ |
|
5 |
"Requires that geometries are not null" |
|
6 |
] |
|
7 |
} |
|
8 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/en/PolygonContainsPolygon.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PolygonContainsPolygon", |
|
3 |
"name": "Contains Polygon", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/contains_polygon.png\">\n", |
|
6 |
"The top polygon is an error because it does not contain a polygon.\n\n", |
|
7 |
"Requires that a polygon in the primary dataset contain at least one", |
|
8 |
"polygon from the secondary dataset.\n" |
|
9 |
] |
|
10 |
} |
|
11 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/en/PolygonContainsPoint.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PolygonContainsPoint", |
|
3 |
"name": "Contains Point", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/contains_point.png\">\n", |
|
6 |
"The top polygon is an error because it does not contain a point.\n\n", |
|
7 |
"Requires that a polygon in the primary dataset contain at least one", |
|
8 |
"point from the secondary dataset.\n", |
|
9 |
"Points must be within the polygon, not on the boundary.\n", |
|
10 |
"This is useful when every polygon should have at least one associated", |
|
11 |
"point, such as when parcels must have an address point." |
|
12 |
], |
|
13 |
"actions" : { |
|
14 |
"CreateFeature": { |
|
15 |
"name" : "Create feature", |
|
16 |
"description": [ |
|
17 |
"The Create Feature fix creates a new point feature at the centroid", |
|
18 |
"of the polygon feature that is causing the error.\n", |
|
19 |
"The point feature that is created is guaranteed to be within the polygon feature." |
|
20 |
] |
|
21 |
} |
|
22 |
} |
|
23 |
} |
|
24 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/en/PolygonContainsOnePoint.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PolygonContainsOnePoint", |
|
3 |
"name": "Contains One Point", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/polygon_contains_one_point.png\">\n", |
|
6 |
"The top polygon is an error because it contains more than one point. Points are errors when they are outside a polygon.\n\nRequires that each polygon contains one point feature and that each point feature falls within a single polygon. This is used when there must be a one-to-one correspondence between features of a polygon feature class and features of a point feature class, such as administrative boundaries and their capital cities. Each point must be properly inside exactly one polygon and each polygon must properly contain exactly one point. Points must be within the polygon, not on the boundary. Requires that each polygon contains one point feature and that each point feature falls within a single polygon. This is used when there must be a one-to-one correspondence between features of a polygon feature class and features of a point feature class, such as administrative boundaries and their capital cities. Each point must be properly inside exactly one polygon and each polygon must properly contain exactly one point. Points must be within the polygon, not on the boundary." |
|
7 |
] |
|
8 |
} |
|
9 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/en/PointMustBeProperlyInsidePolygon.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PointMustBeProperlyInsidePolygon", |
|
3 |
"name": "Must Be Properly Inside", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/PointMustBeProperlyInsidePolygon.png\">\n", |
|
6 |
"Requires that points fall within area features. This is useful when the point features are related to polygons, such as wells and well pads or address points and parcels." |
|
7 |
], |
|
8 |
"actions" : { |
|
9 |
"Delete": { |
|
10 |
"name" : "Delete", |
|
11 |
"description": [ |
|
12 |
"The Delete fix removes point features that are not properly within polygon features. Note that you can use the Edit tool and move the point inside the polygon feature if you do not want to delete it. This fix can be applied to one or more Must Be Properly Inside errors." |
|
13 |
] |
|
14 |
} |
|
15 |
} |
|
16 |
} |
|
17 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/en/LineMustBeCoveredByBoundaryOfPolygon.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "LineMustBeCoveredByBoundaryOfPolygon", |
|
3 |
"name": "Must Be Covered By Boundary Of", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/LineMustBeCoveredByBoundaryOfPolygon.png\">\n", |
|
6 |
"Requires that lines be covered by the boundaries of area features. This is useful for modeling lines, such as lot lines, that must coincide with the edge of polygon features, such as lots." |
|
7 |
], |
|
8 |
"actions" : { |
|
9 |
"Subtract": { |
|
10 |
"name" : "Subtract", |
|
11 |
"description": [ |
|
12 |
"The Subtract fix removes line segments that are not coincident with the boundary of polygon features. If the line feature does not share any segments in common with the boundary of a polygon feature, the feature will be deleted. This fix can be applied to one or more Must Be Covered By Boundary Of errors." |
|
13 |
] |
|
14 |
} |
|
15 |
} |
|
16 |
} |
|
17 |
|
|
0 | 18 |
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/es/GeometryMustNotBeNull.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "GeometryMustNotBeNull", |
|
3 |
"name": "La geometría no debe ser nula", |
|
4 |
"description": [ |
|
5 |
"Requiere que las geometrías no sean nulas" |
|
6 |
] |
|
7 |
} |
|
8 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/es/PolygonContainsPolygon.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PolygonContainsPolygon", |
|
3 |
"name": "Contiene polígono", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/contains_polygon.png\">\n", |
|
6 |
"El polígono superior es un error porque no contiene ningún polígono.\n\n", |
|
7 |
"Requiere que cada polígono del conjunto de datos contenga al menos un polígono del otro conjunto de datos.\n" |
|
8 |
] |
|
9 |
} |
|
10 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/es/PolygonContainsPoint.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PolygonContainsPoint", |
|
3 |
"name": "Contiene punto", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/contains_point.png\">\n", |
|
6 |
"El polígono superior es un error porque no contiene ningún punto.\n\n", |
|
7 |
"Requiere que cada polígono del conjunto de datos contenga al menos un punto del otro conjunto de datos.\n", |
|
8 |
"Los puntos deben estar contenidos en el polígono, no en su perímetro,\n" |
|
9 |
], |
|
10 |
"actions" : { |
|
11 |
"CreateFeature": { |
|
12 |
"name" : "Crear feature", |
|
13 |
"description": [ |
|
14 |
"<i>Crear feature</i> realiza la corrección creando un nuevo punto en", |
|
15 |
"la feature, en el centroide del polígono que ha causado el error.\n", |
|
16 |
"El punto creado en la feature se garantiza que estará dentro del polígono de la feature." |
|
17 |
] |
|
18 |
} |
|
19 |
} |
|
20 |
} |
|
21 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/es/PolygonContainsOnePoint.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PolygonContainsOnePoint", |
|
3 |
"name": "Contiene un punto", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/polygon_contains_one_point.png\">\n", |
|
6 |
"El polígono superior es un error porque contiene más de un punto. Los puntos son errores cuando están fuera de un polígono.\n\nRequiere que cada polígono contenga una entidad de puntos y que cada entidad de puntos se encuentre dentro de un único polígono. Esto se utiliza cuando debe haber una correspondencia uno a uno entre las entidades de una clase de entidad poligonal y las entidades de una clase de entidad de puntos, como los límites administrativos y sus capitales. Cada punto debe estar perfectamente dentro de un polígono y cada polígono debe contener exactamente un punto. Los puntos deben encontrarse en el interior del polígono, no en el límite." |
|
7 |
] |
|
8 |
} |
|
9 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/es/PointMustBeProperlyInsidePolygon.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PointMustBeProperlyInsidePolygon", |
|
3 |
"name": "Debe estar incluida correctamente", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/PointMustBeProperlyInsidePolygon.png\">\n", |
|
6 |
"Requiere que los puntos se encuentren dentro de las entidades de área. Esto resulta útil cuando las entidades de punto están relacionadas con polígonos, tales como pozos y rellenos de pozos o puntos de dirección y parcelas." |
|
7 |
], |
|
8 |
"actions" : { |
|
9 |
"Delete": { |
|
10 |
"name" : "Eliminar", |
|
11 |
"description": [ |
|
12 |
"La solución Eliminar quita las entidades de punto que no se encuentran correctamente dentro de las entidades poligonales. Tenga en cuenta que puede usar la herramienta Editar para mover el punto dentro de la entidad poligonal si no desea eliminarla. Esta solución se puede aplicar a uno o más errores del tipo Debe estar incluida correctamente." |
|
13 |
] |
|
14 |
} |
|
15 |
} |
|
16 |
} |
|
17 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/es/LineMustBeCoveredByBoundaryOfPolygon.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "LineMustBeCoveredByBoundaryOfPolygon", |
|
3 |
"name": "Debe estar cubierto por el límite de", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/LineMustBeCoveredByBoundaryOfPolygon.png\">\n", |
|
6 |
"Requiere que las líneas estén cubiertas por los límites de las entidades de área. Esto es útil para modelar líneas, tales como líneas de lote, que deben coincidir con el eje de las entidades poligonales, tales como lotes." |
|
7 |
], |
|
8 |
"actions" : { |
|
9 |
"Subtract": { |
|
10 |
"name" : "Sustraer", |
|
11 |
"description": [ |
|
12 |
"La solución Sustraer quita los segmentos de línea que no coinciden con el límite de las entidades poligonales. Si la entidad de línea no comparte ningún segmento en común con el límite de una entidad poligonal, la entidad se borrará. Esta solución puede aplicarse a uno o varios errores del tipo Debe estar cubierto por el límite de." |
|
13 |
] |
|
14 |
} |
|
15 |
} |
|
16 |
} |
|
17 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/es/LineMustBeLargerThanTolerance.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "LineMustBeLargerThanTolerance", |
|
3 |
"name": "Debe ser mayor que la tolerancia", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/LineMustBeLargerThanTolerance.png\">\n", |
|
6 |
"Es necesario que una entidad no se colapse durante el proceso de validación. Esta regla es obligatoria para una topología y se aplica a todas las clases de entidad de línea y poligonal. En los casos en los que se infringe esta regla, la geometría original permanece sin cambios." |
|
7 |
], |
|
8 |
"actions" : { |
|
9 |
"delete": { |
|
10 |
"name" : "Eliminar", |
|
11 |
"description": [ |
|
12 |
"La solución Eliminar quita las entidades de línea que se podrían colapsar durante el proceso de validación en base a la tolerancia cluster de la topología. Esta solución se puede aplicar a uno o más errores del tipo Debe ser mayor que la tolerancia cluster." |
|
13 |
] |
|
14 |
} |
|
15 |
} |
|
16 |
} |
|
17 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/es/PolygonMustNotOverlapWithPolygon.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PolygonMustNotOverlapWithPolygon", |
|
3 |
"name": "No debe superponerse con", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/PolygonMustNotOverlapWithPolygon.png\">\n", |
|
6 |
"Requiere que el interior de los pol?gonos en una clase (o subtipo) de entidad no se deba superponer con el interior de los pol?gonos en otra clase (o subtipo) de entidad. Los pol?gonos de las dos clases de entidad pueden compartir ejes o v?rtices o estar completamente inconexos. Esta regla se utiliza cuando un ?rea no puede pertenecer a dos clases de entidad separadas. Resulta ?til para combinar dos sistemas mutuamente exclusivos de clasificaci?n de ?rea, tales como zonificaci?n y tipos de masa de agua, en las que las ?reas definidas en la clase de zonificaci?n tampoco se pueden definir en la clase de masa de agua y viceversa." |
|
7 |
], |
|
8 |
"actions" : { |
|
9 |
"Subtract": { |
|
10 |
"name" : "Subtract", |
|
11 |
"description": [ |
|
12 |
"La soluci?n Sustraer quita la parte de superposici?n de cada entidad que causa el error y deja un espacio o vac?o en su lugar. Esta soluci?n se puede aplicar a uno o m?s errores seleccionados del tipo No debe superponerse con." |
|
13 |
] |
|
14 |
}, |
|
15 |
"Merge": { |
|
16 |
"name" : "Merge", |
|
17 |
"description": [ |
|
18 |
"La soluci?n Fusionar agrega la parte de superposici?n de una entidad y la sustrae del resto que infringen la regla. Es necesario elegir la entidad que recibe la parte de superposici?n utilizando el cuadro de di?logo Fusionar. Esta soluci?n se puede aplicar ?nicamente a un error de tipo No debe superponerse con." |
|
19 |
] |
|
20 |
} |
|
21 |
} |
|
22 |
} |
|
23 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/es/PolygonMustBeCoveredByPolygon.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PolygonMustBeCoveredByPolygon", |
|
3 |
"name": "Debe estar cubierto por", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/PolygonMustBeCoveredByPolygon.png\">\n", |
|
6 |
"Requiere que los polígonos de una clase (o subtipo) de entidad estén contenido en polígonos de otra clase (o subtipo) de entidad. Los polígonos pueden compartir ejes o vértices. Cualquier área definida en la clase de entidad contenida debe estar cubierta por un área en la clase de entidad de cobertura. Esta regla se utiliza cuando las entidades de área de un tipo dado se deben localizar dentro de las entidades de otro tipo. Esta regla es útil al modelar áreas que sean subconjuntos de un área circundante mayor, como unidades de administración en bosques o bloques dentro de grupos de bloques." |
|
7 |
], |
|
8 |
"actions" : { |
|
9 |
"CreateFeature": { |
|
10 |
"name" : "Crear entidad", |
|
11 |
"description": [ |
|
12 |
"La solución Crear entidad crea una nueva entidad poligonal a partir de la parte de superposición del polígono existente, de modo que el límite de cada entidad de ambas clases de entidad es el mismo. Esta solución puede aplicarse a uno o varios errores seleccionados del tipo Debe estar cubierto por." |
|
13 |
] |
|
14 |
} |
|
15 |
} |
|
16 |
} |
|
17 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/resources/org/gvsig/topology/rules/es/PolygonMustNotOverlapPolygon.json | ||
---|---|---|
1 |
{ |
|
2 |
"id": "PolygonMustNotOverlapPolygon", |
|
3 |
"name": "No debe superponerse", |
|
4 |
"description": [ |
|
5 |
"<img src=\"@@@_d/must_not_overlap.png\">\n", |
|
6 |
"Requiere que el interior de los polígonos no se superponga. Los polígonos pueden compartir ejes o vértices. Esta regla se utiliza cuando un área no puede pertenecer a dos o más polígonos. Resulta útil para modelar límites administrativos, como códigos postales o distritos electorales, y clasificaciones de área mutuamente exclusivas, como cobertura de suelo o tipo de forma de suelo." |
|
7 |
], |
|
8 |
"actions" : { |
|
9 |
"CreateFeature": { |
|
10 |
"name" : "Crear entidad", |
|
11 |
"description": [ |
|
12 |
"La solución Crear entidad crea una nueva entidad poligonal fuera de la forma de error y quita la parte de superposición de cada una de las entidades, que provoca el error para crear una representación plana de la geometría de entidad. Esta solución se puede aplicar a uno o más errores seleccionados del tipo No debe superponerse." |
|
13 |
] |
|
14 |
}, |
|
15 |
"Subtract": { |
|
16 |
"name" : "Sustraer", |
|
17 |
"description": [ |
|
18 |
"La solución Sustraer quita la parte de superposición de la geometría de cada entidad que causa el error y deja un espacio o vacío en su lugar. Esta solución se puede aplicar a uno o más errores seleccionados del tipo No debe superponerse. " |
|
19 |
] |
|
20 |
}, |
|
21 |
"Merge": { |
|
22 |
"name" : "Fusionar", |
|
23 |
"description": [ |
|
24 |
"La solución Fusionar agrega la parte de superposición de una entidad y la sustrae del resto que infringen la regla. Es necesario elegir la entidad que recibe la parte de superposición utilizando el cuadro de diálogo Fusionar. Esta solución se puede aplicar únicamente a un error de tipo No debe superponerse." |
|
25 |
] |
|
26 |
} |
|
27 |
} |
|
28 |
} |
|
29 |
|
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/java/org/gvsig/topology/lib/impl/DefaultTopologyReportLine.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.topology.lib.impl; |
|
25 |
|
|
26 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
27 |
import org.gvsig.fmap.geom.Geometry; |
|
28 |
import org.gvsig.topology.lib.api.TopologyDataSet; |
|
29 |
import org.gvsig.topology.lib.api.TopologyReport; |
|
30 |
import org.gvsig.topology.lib.api.TopologyReportLine; |
|
31 |
import org.gvsig.topology.lib.api.TopologyRule; |
|
32 |
|
|
33 |
/** |
|
34 |
* |
|
35 |
* @author jjdelcerro |
|
36 |
*/ |
|
37 |
public class DefaultTopologyReportLine implements TopologyReportLine { |
|
38 |
|
|
39 |
private final TopologyReport report; |
|
40 |
private final TopologyRule rule; |
|
41 |
private final TopologyDataSet dataSet1; |
|
42 |
private final TopologyDataSet dataSet2; |
|
43 |
private final Geometry geometry; |
|
44 |
private final FeatureReference feature1; |
|
45 |
private final FeatureReference feature2; |
|
46 |
private final int primitive1; |
|
47 |
private final int primitive2; |
|
48 |
private boolean exception; |
|
49 |
private final String description; |
|
50 |
private final String data; |
|
51 |
private final Geometry errorGeometry; |
|
52 |
|
|
53 |
DefaultTopologyReportLine(DefaultTopologyReport report, |
|
54 |
TopologyRule rule, |
|
55 |
TopologyDataSet dataSet1, |
|
56 |
TopologyDataSet dataSet2, |
|
57 |
Geometry geometry, |
|
58 |
Geometry error, |
|
59 |
FeatureReference feature1, |
|
60 |
FeatureReference feature2, |
|
61 |
int primitive1, |
|
62 |
int primitive2, |
|
63 |
boolean exception, |
|
64 |
String description, |
|
65 |
String data |
|
66 |
) { |
|
67 |
this.report = report; |
|
68 |
this.rule = rule; |
|
69 |
this.dataSet1 = dataSet1; |
|
70 |
this.dataSet2 = dataSet2; |
|
71 |
this.geometry = geometry; |
|
72 |
this.feature1 = feature1; |
|
73 |
this.feature2 = feature2; |
|
74 |
this.primitive1 = primitive1; |
|
75 |
this.primitive2 = primitive2; |
|
76 |
this.exception = exception; |
|
77 |
this.description = description; |
|
78 |
this.errorGeometry = error; |
|
79 |
this.data = data; |
|
80 |
} |
|
81 |
|
|
82 |
@Override |
|
83 |
public TopologyRule getRule() { |
|
84 |
return this.rule; |
|
85 |
} |
|
86 |
|
|
87 |
@Override |
|
88 |
public TopologyDataSet getDataSet1() { |
|
89 |
return this.dataSet1; |
|
90 |
} |
|
91 |
|
|
92 |
@Override |
|
93 |
public TopologyDataSet getDataSet2() { |
|
94 |
return this.dataSet2; |
|
95 |
} |
|
96 |
|
|
97 |
@Override |
|
98 |
public Geometry getGeometry() { |
|
99 |
return this.geometry; |
|
100 |
} |
|
101 |
|
|
102 |
@Override |
|
103 |
public FeatureReference getFeature1() { |
|
104 |
return this.feature1; |
|
105 |
} |
|
106 |
|
|
107 |
@Override |
|
108 |
public FeatureReference getFeature2() { |
|
109 |
return this.feature2; |
|
110 |
} |
|
111 |
|
|
112 |
@Override |
|
113 |
public boolean isException() { |
|
114 |
return this.exception; |
|
115 |
} |
|
116 |
|
|
117 |
public void setException(boolean exception) { |
|
118 |
this.exception = exception; |
|
119 |
} |
|
120 |
|
|
121 |
@Override |
|
122 |
public String getDescription() { |
|
123 |
return description; |
|
124 |
} |
|
125 |
|
|
126 |
@Override |
|
127 |
public Geometry getError() { |
|
128 |
return this.errorGeometry; |
|
129 |
} |
|
130 |
|
|
131 |
@Override |
|
132 |
public int getPrimitiveNumber1() { |
|
133 |
return this.primitive1; |
|
134 |
} |
|
135 |
|
|
136 |
@Override |
|
137 |
public int getPrimitiveNumber2() { |
|
138 |
return this.primitive2; |
|
139 |
} |
|
140 |
|
|
141 |
@Override |
|
142 |
public String getData() { |
|
143 |
return this.data; |
|
144 |
} |
|
145 |
} |
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/java/org/gvsig/topology/lib/impl/DefaultTopologyDataSet.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.topology.lib.impl; |
|
25 |
|
|
26 |
import java.util.Iterator; |
|
27 |
import java.util.Map; |
|
28 |
import javax.json.JsonObject; |
|
29 |
import org.apache.commons.collections.IteratorUtils; |
|
30 |
import org.apache.commons.lang3.StringUtils; |
|
31 |
import org.apache.commons.lang3.mutable.MutableObject; |
|
32 |
import org.gvsig.expressionevaluator.Expression; |
|
33 |
import org.gvsig.expressionevaluator.ExpressionUtils; |
|
34 |
import org.gvsig.expressionevaluator.GeometryExpressionBuilder; |
|
35 |
import org.gvsig.expressionevaluator.GeometryExpressionUtils; |
|
36 |
import org.gvsig.fmap.dal.DataStore; |
|
37 |
import org.gvsig.fmap.dal.EditingNotification; |
|
38 |
import org.gvsig.fmap.dal.EditingNotificationManager; |
|
39 |
import org.gvsig.fmap.dal.exception.DataException; |
|
40 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
|
41 |
import org.gvsig.fmap.dal.feature.Feature; |
|
42 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
43 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
|
44 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
|
45 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
46 |
import org.gvsig.fmap.dal.feature.FeatureStoreProviderFactory; |
|
47 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
48 |
import org.gvsig.fmap.dal.swing.DALSwingLocator; |
|
49 |
import org.gvsig.fmap.geom.Geometry; |
|
50 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
51 |
import org.gvsig.fmap.geom.GeometryManager; |
|
52 |
import org.gvsig.fmap.geom.GeometryUtils; |
|
53 |
import org.gvsig.fmap.geom.SpatialIndex; |
|
54 |
import org.gvsig.fmap.geom.type.GeometryType; |
|
55 |
import org.gvsig.json.Json; |
|
56 |
import org.gvsig.json.JsonObjectBuilder; |
|
57 |
import org.gvsig.tools.dispose.DisposableIterator; |
|
58 |
import org.gvsig.tools.exception.BaseException; |
|
59 |
import org.gvsig.tools.util.PropertiesSupportHelper; |
|
60 |
import org.gvsig.tools.visitor.VisitCanceledException; |
|
61 |
import org.gvsig.tools.visitor.Visitor; |
|
62 |
import org.gvsig.topology.lib.api.CancelOperationException; |
|
63 |
import org.gvsig.topology.lib.api.PerformOperationException; |
|
64 |
import org.gvsig.topology.lib.api.TopologyDataSet; |
|
65 |
import org.gvsig.topology.lib.api.TopologyLocator; |
|
66 |
import org.gvsig.topology.lib.api.TopologyManager; |
|
67 |
import org.gvsig.topology.lib.api.TopologyServices; |
|
68 |
import org.slf4j.Logger; |
|
69 |
import org.slf4j.LoggerFactory; |
|
70 |
|
|
71 |
/** |
|
72 |
* |
|
73 |
* @author jjdelcerro |
|
74 |
*/ |
|
75 |
@SuppressWarnings({"EqualsAndHashcode","UseSpecificCatch"}) |
|
76 |
public class DefaultTopologyDataSet implements TopologyDataSet { |
|
77 |
|
|
78 |
private final static Logger LOGGER = LoggerFactory.getLogger(DefaultTopologyDataSet.class); |
|
79 |
|
|
80 |
private TopologyServices services; |
|
81 |
private String name; |
|
82 |
private DataStore store; |
|
83 |
private boolean needFinishEditing; |
|
84 |
private String fullName; |
|
85 |
private PropertiesSupportHelper propertiesHelper; |
|
86 |
private MutableObject<SpatialIndex> spatialIndex = null; |
|
87 |
|
|
88 |
public DefaultTopologyDataSet() { |
|
89 |
this.services = null; |
|
90 |
this.name = null; |
|
91 |
this.store = null; |
|
92 |
this.needFinishEditing = false; |
|
93 |
this.fullName = null; |
|
94 |
this.propertiesHelper = new PropertiesSupportHelper(); |
|
95 |
} |
|
96 |
|
|
97 |
public DefaultTopologyDataSet(TopologyServices services, String name, DataStore store) { |
|
98 |
this.services = services; |
|
99 |
this.name = name; |
|
100 |
this.store = store; |
|
101 |
this.needFinishEditing = false; |
|
102 |
if( store!=null ) { |
|
103 |
this.fullName = store.getFullName(); |
|
104 |
} |
|
105 |
} |
|
106 |
|
|
107 |
@Override |
|
108 |
public void restart() { |
|
109 |
this.store = null; |
|
110 |
this.spatialIndex = null; |
|
111 |
} |
|
112 |
|
|
113 |
@Override |
|
114 |
public boolean equals(Object obj) { |
|
115 |
if( !(obj instanceof DefaultTopologyDataSet) ) { |
|
116 |
return false; |
|
117 |
} |
|
118 |
DefaultTopologyDataSet other = (DefaultTopologyDataSet)obj; |
|
119 |
if( this.store != other.store ) { |
|
120 |
return false; |
|
121 |
} |
|
122 |
if( !StringUtils.equals(this.getName(), other.getName()) ) { |
|
123 |
return false; |
|
124 |
} |
|
125 |
return true; |
|
126 |
} |
|
127 |
|
|
128 |
@Override |
|
129 |
public String getName() { |
|
130 |
return this.name; |
|
131 |
} |
|
132 |
|
|
133 |
@Override |
|
134 |
public void setName(String name) { |
|
135 |
this.name = name; |
|
136 |
} |
|
137 |
|
|
138 |
@Override |
|
139 |
public String toString() { |
|
140 |
try { |
|
141 |
FeatureAttributeDescriptor attr = this.getFeatureStore().getDefaultFeatureType().getDefaultGeometryAttribute(); |
|
142 |
String geomType = attr.getGeomType().getName(); |
|
143 |
return this.name + " ("+ geomType + ")"; |
|
144 |
} catch(Exception ex) { |
|
145 |
return this.name ; |
|
146 |
} |
|
147 |
} |
|
148 |
|
|
149 |
@Override |
|
150 |
public void setStore(DataStore store) { |
|
151 |
this.store = store; |
|
152 |
} |
|
153 |
|
|
154 |
@Override |
|
155 |
public DataStore getStore() { |
|
156 |
if (this.store == null) { |
|
157 |
this.store = this.services.getFeatureStore(this); |
|
158 |
} |
|
159 |
return this.store; |
|
160 |
} |
|
161 |
|
|
162 |
@Override |
|
163 |
public FeatureStore getFeatureStore() { |
|
164 |
if (this.store == null) { |
|
165 |
this.store = this.services.getFeatureStore(this); |
|
166 |
} |
|
167 |
return (FeatureStore) this.store; |
|
168 |
} |
|
169 |
|
|
170 |
@Override |
|
171 |
public long getSize() { |
|
172 |
try { |
|
173 |
long size = this.getFeatureStore().getFeatureCount(); |
|
174 |
return size; |
|
175 |
} catch (DataException ex) { |
|
176 |
// TODO: mensage al log |
|
177 |
return 0; |
|
178 |
} |
|
179 |
} |
|
180 |
|
|
181 |
@Override |
|
182 |
public boolean isThisStore(FeatureStore store) { |
|
183 |
if( store == null ) { |
|
184 |
return false; |
|
185 |
} |
|
186 |
return StringUtils.equals(this.fullName, store.getFullName()); |
|
187 |
} |
|
188 |
|
|
189 |
@Override |
|
190 |
public int getGeometryType() { |
|
191 |
try { |
|
192 |
FeatureStore theStore = this.getFeatureStore(); |
|
193 |
FeatureType featureType = theStore.getDefaultFeatureType(); |
|
194 |
FeatureAttributeDescriptor attr = featureType.getDefaultGeometryAttribute(); |
|
195 |
GeometryType geomType = attr.getGeomType(); |
|
196 |
return geomType.getType(); |
|
197 |
} catch (Exception ex) { |
|
198 |
return Geometry.TYPES.GEOMETRY; |
|
199 |
} |
|
200 |
} |
|
201 |
|
|
202 |
@Override |
|
203 |
public void accept(Visitor visitor) throws VisitCanceledException { |
|
204 |
FeatureStore st = this.getFeatureStore(); |
|
205 |
try { |
|
206 |
st.accept(visitor); |
|
207 |
} catch(VisitCanceledException ex) { |
|
208 |
throw ex; |
|
209 |
} catch(BaseException ex) { |
|
210 |
throw new RuntimeException(ex); |
|
211 |
} |
|
212 |
} |
|
213 |
|
|
214 |
@Override |
|
215 |
public void edit() throws DataException { |
|
216 |
FeatureStore theStore = this.getFeatureStore(); |
|
217 |
if (!theStore.isEditing()) { |
|
218 |
theStore.edit(); |
|
219 |
this.needFinishEditing = true; |
|
220 |
} |
|
221 |
} |
|
222 |
|
|
223 |
@Override |
|
224 |
public void finishEditing() throws DataException { |
|
225 |
if (this.needFinishEditing) { |
|
226 |
this.getFeatureStore().finishEditing(); |
|
227 |
} |
|
228 |
} |
|
229 |
|
|
230 |
@Override |
|
231 |
public EditableFeature createNewFeature() throws DataException { |
|
232 |
EditableFeature f = this.getFeatureStore().createNewFeature(); |
|
233 |
return f; |
|
234 |
} |
|
235 |
|
|
236 |
public void perform( |
|
237 |
String operation, |
|
238 |
Feature feature |
|
239 |
) throws DataException { |
|
240 |
this.edit(); |
|
241 |
|
|
242 |
EditingNotificationManager editingNotificationManager |
|
243 |
= DALSwingLocator.getEditingNotificationManager(); |
|
244 |
FeatureStore theStore = this.getFeatureStore(); |
|
245 |
|
|
246 |
EditingNotification notification |
|
247 |
= editingNotificationManager.notifyObservers(this, // source |
|
248 |
operation, // type |
|
249 |
null,// document |
|
250 |
null,// layer |
|
251 |
theStore,// store |
|
252 |
feature// feature |
|
253 |
); |
|
254 |
|
|
255 |
if (notification.isCanceled()) { |
|
256 |
String msg = String.format( |
|
257 |
"Can't insert feature into %1$s, canceled by some observer.", |
|
258 |
this.getName()); |
|
259 |
throw new CancelOperationException(msg); |
|
260 |
} |
|
261 |
|
|
262 |
String after = null; |
|
263 |
if( operation.equalsIgnoreCase(EditingNotification.BEFORE_REMOVE_FEATURE) ) { |
|
264 |
theStore.delete(feature); |
|
265 |
after = EditingNotification.AFTER_REMOVE_FEATURE; |
|
266 |
|
|
267 |
} else { |
|
268 |
if (notification.shouldValidateTheFeature()) { |
|
269 |
if (!editingNotificationManager.validateFeature(feature)) { |
|
270 |
String msg = String.format("%1$s is not valid", feature.toString()); |
|
271 |
throw new PerformOperationException(msg); |
|
272 |
} |
|
273 |
} |
|
274 |
switch(operation) { |
|
275 |
case EditingNotification.BEFORE_UPDATE_FEATURE: |
|
276 |
theStore.update((EditableFeature) feature); |
|
277 |
after = EditingNotification.AFTER_UPDATE_FEATURE; |
|
278 |
break; |
|
279 |
|
|
280 |
case EditingNotification.BEFORE_INSERT_FEATURE: |
|
281 |
theStore.insert((EditableFeature) feature); |
|
282 |
after = EditingNotification.AFTER_INSERT_FEATURE; |
|
283 |
break; |
|
284 |
} |
|
285 |
} |
|
286 |
|
|
287 |
editingNotificationManager.notifyObservers(this, |
|
288 |
after, null, null, |
|
289 |
theStore, feature); |
|
290 |
|
|
291 |
} |
|
292 |
|
|
293 |
@Override |
|
294 |
public void insert(final EditableFeature feature) throws DataException { |
|
295 |
perform( |
|
296 |
EditingNotification.BEFORE_INSERT_FEATURE, |
|
297 |
feature |
|
298 |
); |
|
299 |
} |
|
300 |
|
|
301 |
@Override |
|
302 |
public void update(final EditableFeature feature) throws DataException { |
|
303 |
perform( |
|
304 |
EditingNotification.BEFORE_UPDATE_FEATURE, |
|
305 |
feature |
|
306 |
); |
|
307 |
} |
|
308 |
|
|
309 |
@Override |
|
310 |
public void delete(final Feature feature) throws DataException { |
|
311 |
perform( |
|
312 |
EditingNotification.BEFORE_REMOVE_FEATURE, |
|
313 |
feature |
|
314 |
); |
|
315 |
} |
|
316 |
|
|
317 |
@Override |
|
318 |
public void delete(final FeatureReference feature) throws DataException { |
|
319 |
perform( |
|
320 |
EditingNotification.BEFORE_REMOVE_FEATURE, |
|
321 |
feature.getFeature() |
|
322 |
); |
|
323 |
} |
|
324 |
|
|
325 |
@Override |
|
326 |
public JsonObject toJson() { |
|
327 |
return this.toJsonBuilder().build(); |
|
328 |
} |
|
329 |
|
|
330 |
@Override |
|
331 |
public JsonObjectBuilder toJsonBuilder() { |
|
332 |
JsonObjectBuilder jsonDataSet = Json.createObjectBuilder(); |
|
333 |
jsonDataSet.add("name", this.name); |
|
334 |
jsonDataSet.add("fullName", this.fullName); |
|
335 |
|
|
336 |
return jsonDataSet; |
|
337 |
} |
|
338 |
|
|
339 |
@Override |
|
340 |
public void fromJson(JsonObject json) { |
|
341 |
TopologyManager manager = TopologyLocator.getTopologyManager(); |
|
342 |
this.name = json.getString("name"); |
|
343 |
this.fullName = null; |
|
344 |
if( json.containsKey("fullName") ) { |
|
345 |
this.fullName = json.getString("fullName"); |
|
346 |
} |
|
347 |
this.store = null; |
|
348 |
this.needFinishEditing = false; |
|
349 |
this.services = manager.getDefaultServices(); |
|
350 |
} |
|
351 |
|
|
352 |
@Override |
|
353 |
public Object getProperty(String string) { |
|
354 |
return this.propertiesHelper.getProperty(name); |
|
355 |
} |
|
356 |
|
|
357 |
@Override |
|
358 |
public void setProperty(String string, Object o) { |
|
359 |
this.propertiesHelper.setProperty(name, o); |
|
360 |
} |
|
361 |
|
|
362 |
@Override |
|
363 |
public Map<String, Object> getProperties() { |
|
364 |
return this.propertiesHelper.getProperties(); |
|
365 |
} |
|
366 |
|
|
367 |
@Override |
|
368 |
public SpatialIndex getSpatialIndex() { |
|
369 |
if( this.spatialIndex == null ) { |
|
370 |
this.spatialIndex = new MutableObject<>(); |
|
371 |
FeatureStore theStore = this.getFeatureStore(); |
|
372 |
FeatureStoreProviderFactory storeFactory = (FeatureStoreProviderFactory) theStore.getProviderFactory(); |
|
373 |
if( storeFactory.useLocalIndexesCanImprovePerformance()==FeatureStoreProviderFactory.YES ) { |
|
374 |
try { |
|
375 |
GeometryManager geomManager = GeometryLocator.getGeometryManager(); |
|
376 |
final SpatialIndex geomIndex = geomManager.createSpatialIndex( |
|
377 |
GeometryManager.SPATIALINDEX_DEFAULT_QUADTREE, |
|
378 |
null |
|
379 |
); |
|
380 |
final SpatialIndex dataIndex = theStore.wrapSpatialIndex(geomIndex); |
|
381 |
try { |
|
382 |
store.accept((Object o) -> { |
|
383 |
Feature f = (Feature) o; |
|
384 |
Geometry geom = f.getDefaultGeometry(); |
|
385 |
if (geom != null) { |
|
386 |
dataIndex.insert(geom, f); |
|
387 |
} |
|
388 |
}); |
|
389 |
} catch (VisitCanceledException ex) { |
|
390 |
} |
|
391 |
this.spatialIndex.setValue(dataIndex); |
|
392 |
} catch (Exception ex) { |
|
393 |
LOGGER.warn("Can't create spatial index", ex); |
|
394 |
} |
|
395 |
} |
|
396 |
} |
|
397 |
return this.spatialIndex.getValue(); |
|
398 |
} |
|
399 |
|
|
400 |
@Override |
|
401 |
public Iterable<FeatureReference> query(Geometry geom) { |
|
402 |
return this.queryReferences(geom); |
|
403 |
} |
|
404 |
|
|
405 |
@Override |
|
406 |
public Iterable<FeatureReference> queryReferences(Geometry geom) { |
|
407 |
SpatialIndex index = this.getSpatialIndex(); |
|
408 |
if( index == null ) { |
|
409 |
try { |
|
410 |
FeatureStore theStore = (FeatureStore) this.getStore(); |
|
411 |
Expression expression = ExpressionUtils.createExpression(); |
|
412 |
GeometryExpressionBuilder expressionBuilder = GeometryExpressionUtils.createExpressionBuilder(); |
|
413 |
String geomName = theStore.getDefaultFeatureType().getDefaultGeometryAttributeName(); |
|
414 |
if( GeometryUtils.isSubtype(Geometry.TYPES.POINT, geom.getType()) ) { |
|
415 |
expression.setPhrase( |
|
416 |
expressionBuilder.ifnull( |
|
417 |
expressionBuilder.column(geomName), |
|
418 |
expressionBuilder.constant(false), |
|
419 |
expressionBuilder.ST_Intersects( |
|
420 |
expressionBuilder.column(geomName), |
|
421 |
expressionBuilder.geometry(geom) |
|
422 |
) |
|
423 |
).toString() |
|
424 |
); |
|
425 |
} else { |
|
426 |
expression.setPhrase( |
|
427 |
expressionBuilder.ifnull( |
|
428 |
expressionBuilder.column(geomName), |
|
429 |
expressionBuilder.constant(false), |
|
430 |
expressionBuilder.ST_Overlaps( |
|
431 |
expressionBuilder.column(geomName), |
|
432 |
expressionBuilder.envelope(geom.getEnvelope()) |
|
433 |
) |
|
434 |
).toString() |
|
435 |
); |
|
436 |
} |
|
437 |
FeatureSet set = theStore.getFeatureSet(expression); |
|
438 |
final DisposableIterator it = set.fastIterator(); |
|
439 |
return () -> new Iterator<FeatureReference>() { |
|
440 |
@Override |
|
441 |
public boolean hasNext() { |
|
442 |
return it.hasNext(); |
|
443 |
} |
|
444 |
|
|
445 |
@Override |
|
446 |
public FeatureReference next() { |
|
447 |
Feature f = (Feature) it.next(); |
|
448 |
return f.getReference(); |
|
449 |
} |
|
450 |
}; |
|
451 |
|
|
452 |
} catch(Exception ex) { |
|
453 |
return (Iterable<FeatureReference>) IteratorUtils.EMPTY_ITERATOR; |
|
454 |
} |
|
455 |
} |
|
456 |
final Iterator it = index.query(geom); |
|
457 |
if( it == null ) { |
|
458 |
return (Iterable<FeatureReference>) IteratorUtils.EMPTY_ITERATOR; |
|
459 |
} |
|
460 |
return () -> it; |
|
461 |
} |
|
462 |
|
|
463 |
@Override |
|
464 |
public Iterable<Feature> queryFeatures(Geometry geom) { |
|
465 |
SpatialIndex index = this.getSpatialIndex(); |
|
466 |
if( index == null ) { |
|
467 |
try { |
|
468 |
FeatureStore theStore = (FeatureStore) this.getStore(); |
|
469 |
Expression expression = ExpressionUtils.createExpression(); |
|
470 |
GeometryExpressionBuilder expressionBuilder = GeometryExpressionUtils.createExpressionBuilder(); |
|
471 |
String geomName = theStore.getDefaultFeatureType().getDefaultGeometryAttributeName(); |
|
472 |
if( GeometryUtils.isSubtype(Geometry.TYPES.POINT, geom.getType()) ) { |
|
473 |
expression.setPhrase( |
|
474 |
expressionBuilder.ifnull( |
|
475 |
expressionBuilder.column(geomName), |
|
476 |
expressionBuilder.constant(false), |
|
477 |
expressionBuilder.ST_Intersects( |
|
478 |
expressionBuilder.column(geomName), |
|
479 |
expressionBuilder.geometry(geom) |
|
480 |
) |
|
481 |
).toString() |
|
482 |
); |
|
483 |
} else { |
|
484 |
expression.setPhrase( |
|
485 |
expressionBuilder.ifnull( |
|
486 |
expressionBuilder.column(geomName), |
|
487 |
expressionBuilder.constant(false), |
|
488 |
expressionBuilder.ST_Overlaps( |
|
489 |
expressionBuilder.column(geomName), |
|
490 |
expressionBuilder.envelope(geom.getEnvelope()) |
|
491 |
) |
|
492 |
).toString() |
|
493 |
); |
|
494 |
} |
|
495 |
FeatureSet set = theStore.getFeatureSet(expression); |
|
496 |
final DisposableIterator it = set.fastIterator(); |
|
497 |
return () -> it; |
|
498 |
|
|
499 |
} catch(Exception ex) { |
|
500 |
return (Iterable<Feature>) IteratorUtils.EMPTY_ITERATOR; |
|
501 |
} |
|
502 |
} |
|
503 |
final Iterator it = index.query(geom); |
|
504 |
if( it == null ) { |
|
505 |
return (Iterable<Feature>) IteratorUtils.EMPTY_ITERATOR; |
|
506 |
} |
|
507 |
return () -> new Iterator<Feature>() { |
|
508 |
@Override |
|
509 |
public boolean hasNext() { |
|
510 |
return it.hasNext(); |
|
511 |
} |
|
512 |
|
|
513 |
@Override |
|
514 |
public Feature next() { |
|
515 |
FeatureReference ref = (FeatureReference) it.next(); |
|
516 |
try { |
|
517 |
return ref.getFeature(); |
|
518 |
} catch (DataException ex) { |
|
519 |
return null; |
|
520 |
} |
|
521 |
} |
|
522 |
}; |
|
523 |
} |
|
524 |
|
|
525 |
@Override |
|
526 |
public Feature findFirst(Expression filter) { |
|
527 |
try { |
|
528 |
return this.getFeatureStore().findFirst(filter); |
|
529 |
} catch (Exception ex) { |
|
530 |
return null; |
|
531 |
} |
|
532 |
} |
|
533 |
|
|
534 |
void setTopologyServices(TopologyServices services) { |
|
535 |
this.services = services; |
|
536 |
this.restart(); |
|
537 |
} |
|
538 |
|
|
539 |
} |
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/java/org/gvsig/topology/lib/impl/customizablerule/CustomizableRuleActionImpl.java | ||
---|---|---|
1 |
package org.gvsig.topology.lib.impl.customizablerule; |
|
2 |
|
|
3 |
import javax.json.JsonObject; |
|
4 |
import org.gvsig.expressionevaluator.Expression; |
|
5 |
import org.gvsig.expressionevaluator.ExpressionUtils; |
|
6 |
import org.gvsig.expressionevaluator.MutableSymbolTable; |
|
7 |
import org.gvsig.json.Json; |
|
8 |
import org.gvsig.json.JsonObjectBuilder; |
|
9 |
import org.gvsig.json.SupportJson; |
|
10 |
import org.gvsig.tools.dynobject.DynObject; |
|
11 |
import org.gvsig.topology.lib.api.ExecuteTopologyRuleActionException; |
|
12 |
import org.gvsig.topology.lib.api.TopologyReportLine; |
|
13 |
import org.gvsig.topology.lib.api.TopologyRule; |
|
14 |
import org.gvsig.topology.lib.spi.AbstractTopologyRuleAction; |
|
15 |
|
|
16 |
/** |
|
17 |
* |
|
18 |
* @author gvSIG Team |
|
19 |
*/ |
|
20 |
public class CustomizableRuleActionImpl |
|
21 |
extends AbstractTopologyRuleAction |
|
22 |
implements SupportJson { |
|
23 |
|
|
24 |
protected Expression action; |
|
25 |
protected MutableSymbolTable symbolTable; |
|
26 |
|
|
27 |
public CustomizableRuleActionImpl() { |
|
28 |
super(CustomizableRule0ActionsFactory.NAME); |
|
29 |
} |
|
30 |
|
|
31 |
public Expression getAction() { |
|
32 |
return this.action; |
|
33 |
} |
|
34 |
|
|
35 |
public void setAction(Expression action) { |
|
36 |
this.action = action; |
|
37 |
} |
|
38 |
|
|
39 |
public void setId(String id) { |
|
40 |
this.idAction = id; |
|
41 |
} |
|
42 |
|
|
43 |
public void setName(String name) { |
|
44 |
this.name = name; |
|
45 |
} |
|
46 |
|
|
47 |
public void setShortDescription(String description) { |
|
48 |
this.shortDescription = description; |
|
49 |
} |
|
50 |
|
|
51 |
public MutableSymbolTable getSymbolTable() { |
|
52 |
if (this.symbolTable == null) { |
|
53 |
this.symbolTable = ExpressionUtils.createSymbolTable(); |
|
54 |
this.symbolTable.setVar("action", this); |
|
55 |
} |
|
56 |
return this.symbolTable; |
|
57 |
} |
|
58 |
|
|
59 |
@Override |
|
60 |
public int execute(TopologyRule rule, TopologyReportLine line, DynObject parameters) throws ExecuteTopologyRuleActionException { |
|
61 |
MutableSymbolTable st = this.getSymbolTable(); |
|
62 |
st.setVar("rule", rule); |
|
63 |
st.setVar("line", line); |
|
64 |
st.setVar("parameters", parameters); |
|
65 |
this.action.execute(symbolTable); |
|
66 |
return EXECUTE_OK; |
|
67 |
} |
|
68 |
|
|
69 |
@Override |
|
70 |
public void fromJson(JsonObject json) { |
|
71 |
this.idAction = (String) Json.toObject(json, "idAction"); |
|
72 |
this.idRule = (String) Json.toObject(json, "idRule"); |
|
73 |
this.name = (String) Json.toObject(json, "name"); |
|
74 |
this.shortDescription = (String) Json.toObject(json, "shortDescription"); |
|
75 |
this.action = (Expression) Json.toObject(json, "expression"); |
|
76 |
} |
|
77 |
|
|
78 |
@Override |
|
79 |
public JsonObject toJson() { |
|
80 |
return toJsonBuilder().build(); |
|
81 |
} |
|
82 |
|
|
83 |
@Override |
|
84 |
public JsonObjectBuilder toJsonBuilder() { |
|
85 |
JsonObjectBuilder builder = Json.createObjectBuilder(); |
|
86 |
builder.add("idAction", idAction); |
|
87 |
builder.add("idRule", idRule); |
|
88 |
builder.add("name", name); |
|
89 |
builder.add("shortDescription", shortDescription); |
|
90 |
builder.add("expression", action); |
|
91 |
return builder; |
|
92 |
} |
|
93 |
|
|
94 |
} |
org.gvsig.topology/tags/org.gvsig.topology-1.0.163/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/java/org/gvsig/topology/lib/impl/customizablerule/CustomizableRule0ActionsImpl.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2021 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.topology.lib.impl.customizablerule; |
|
25 |
|
|
26 |
import org.apache.commons.lang3.StringUtils; |
|
27 |
import org.gvsig.expressionevaluator.Expression; |
|
28 |
import org.gvsig.expressionevaluator.MutableSymbolTable; |
|
29 |
import org.gvsig.fmap.dal.DALLocator; |
|
30 |
import org.gvsig.fmap.dal.DataTypeUtils; |
|
31 |
import org.gvsig.fmap.dal.expressionevaluator.FeatureSymbolTable; |
|
32 |
import org.gvsig.fmap.dal.feature.Feature; |
|
33 |
import org.gvsig.tools.ToolsLocator; |
|
34 |
import org.gvsig.tools.task.SimpleTaskStatus; |
|
35 |
import org.gvsig.topology.lib.api.TopologyReport; |
|
36 |
import org.gvsig.topology.lib.api.TopologyRuleFactory; |
|
37 |
import static org.gvsig.topology.lib.impl.customizablerule.CustomizableRule0ActionsFactory.PARAM_CHECK_NAME; |
|
38 |
import static org.gvsig.topology.lib.impl.customizablerule.CustomizableRule0ActionsFactory.PARAM_ERRMSG_NAME; |
|
39 |
import static org.gvsig.topology.lib.impl.customizablerule.CustomizableRule0ActionsFactory.PARAM_NAME_NAME; |
|
40 |
import org.gvsig.topology.lib.spi.AbstractTopologyRule; |
|
41 |
|
|
42 |
/** |
|
43 |
* |
|
44 |
* @author gvSIG Team |
|
45 |
*/ |
Also available in: Unified diff