-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opción para dividir un municipio grande usando un archivo #78
Comments
Hay que implementar layer.BaseLayer.remove_outside_features para que se cumplan estos tests. Los archivos test/split1.geojson, 2 y 3 son muy parecidos. El primero contiene polígonos, el segundo multipolígonos y el tercero tiene distinto CRS
@Crashillo mira el último commit |
El código de remove_outside_features(self, split) sería
También se puede hacer más rápido construyendo un índice espacial getIndex(), |
(NOTA: me había confundido de issue al escribir esto, lo he borrado de allí y movido aquí) Estaba justo haciendo este método en def remove_outside_features(self, geometry):
"""Remove from self any feature not contained in geometry features."""
for feat in self.getFeatures():
geom = feat.geometry()
if not geometry.contains(geom):
self.deleteFeature(feat.id()) Lo he pensado de esta manera puesto que no veía tan eficiente pasarle el layer como parámetro, y recorrer las features para generar el geometry total. De este modo, en |
Si escondemos esos detalles dentro de remove_outside_features mejor. Se le pasa split como layer y que se apañe. No hace falta construir una geometría para comparar, sino recorrer split y comparar con cada geometría de split.
Creo recordar que es más rápido recopilar los id y borrar después con deleteFeatures que eliminar feature por feature.
|
Paso filtrado de zonas a método aparte. Genera self.zone para filtrar como si se hubiera usado -o En process_tasks, uso método search de layer.BaseLayer con un pequeño cambio. Ajusto output_zoning para que no saque zonificación de urbana y rústica cuando no se procesa el municipio completo. Ajusto tests de remove_outside_features
Tengo una duda que no he sido capaz de encontrar en la documentación sobre |
Admitiría todos los formatos OGR
https://live.osgeo.org/es/overview/gdal_overview.html
O sea que shp sin problema ninguno. Poly no.
El dom., 2 ene. 2022 11:59, Hugoren Martinako ***@***.***>
escribió:
… Tengo una duda que no he sido capaz de encontrar en la documentación sobre
QgsVectorLayer, al crearlo pasándole un path, siempre usamos un fichero
geojson. ¿Admite otros formatos, .poly o .shp, por ejemplo?
—
Reply to this email directly, view it on GitHub
<#78 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMIBRPC447B32DD2CHTAALUUA4ZTANCNFSM5K6JHFTQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
El objetivo es preservar archivos como report.txt, highway_names.csv, etc sin que colisionen entre ejecuciones. * Si se crean los archivos de tareas, añade en 'tasks' archivos importantes para preservar en el repositorio. * Si se usa la opción -s <split> mueve 'tasks' a 'tasks-<split>' (sin extensión) * Si no se usa -s pero si -o <zonas> mueve 'tasks' a 'tasks-<hash>' (código único) La opción -m añadir comentarios se ve afectada.
|
Permite recoger con -o zonas que se hayan escapado al dibujar el archivo de -s. * En layer.remove_outside_features acepta una lista de etiquetas a excluir de la eliminación. * en app.split_zoning self.zone se reconstruye manteniendo las etiquetas previas.
Similar a -o pero usando un área definida en un archivo.
Ejemplo en la consola interactiva de python
The text was updated successfully, but these errors were encountered: