diff --git a/README.md b/README.md index 3964f31..97fef8e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# django-geocad 1.5.0 +# django-geocad 1.6.0 Django app that imports CAD drawings in Leaflet maps ## Overview Show CAD drawings with no geo location in interactive web maps. Change / add layers to drawings, change / add elements to layers, change blocks and change / add it's instances, download changed DXF files. @@ -11,27 +11,26 @@ In your project root type `git clone https://github.com/andywar65/djeocad`, add "DEFAULT_ZOOM": 10, "RESET_VIEW": False, }` -If you want a satellite map layer you need a [Mapbox](https://www.mapbox.com/) token adding this to `settings.py` (I use `environs` for secrets): -`MAPBOX_TOKEN = env.str("MAPBOX_TOKEN")` +If you want a satellite map layer you need a [Mapbox](https://www.mapbox.com/) token adding this to `settings.py` (I use `environs` for secrets): `MAPBOX_TOKEN = env.str("MAPBOX_TOKEN")` ## Usage -Django-geocad has three models: `Drawing`, `Layer` and `Insertion`. Creation, update and deletion of models may happen in admin, where you will need staff permission to perform these tasks. A `GeoCAD Manager` permission group is created at migration, but at the moment the feature is not implemented. -To create a `Drawing` you will need a `DXF file` in ASCII format. `DXF` is a drawing exchange -format widely used in `CAD` applications. +Django-geocad has three models: `Drawing`, `Layer` and `Insertion`. Creation, update and deletion of models may happen in admin or on the frontend. To perform these tasks user must be granted `GeoCAD Manager` permission group (created at migration). +To create a `Drawing` you will need a `DXF file` in ASCII format. `DXF` is a drawing exchange format widely used in `CAD` applications. If `geodata` is embedded in the file, it will be ignored: this app is suitable for small drawings, -representing a building, a group of buildings or a small neighborhood. To geolocate the drawing you just need to know where your `World Coordinate System origin (0,0,0)` is located. A good position for the `WCS origin` could be the cornerstone of a building, or another geographic landmark close to -the items of the drawing. -Check also the rotation of the `Y axis` with respect to the `True North`: it is typical to orient -the drawings most conveniently for drafting purposes, unrespectful of True North. Please note that positive angles (from Y axis to True North) are counter clockwise. +representing a building, a group of buildings or a small neighborhood. To geolocate the drawing you just need to know where your `World Coordinate System origin (0,0,0)` is located. A good position for the `WCS origin` could be the cornerstone of a building, or another geographic landmark close to the items of the drawing. +Check also the rotation of the `Y axis` with respect to the `True North`: it is typical to orient the drawings most conveniently for drafting purposes, unrespectful of True North. Please note that positive angles (from Y axis to True North) are counter clockwise. So back to our admin panel, let's add a Drawing. You will have to select the `Author` of the drawing, a `Title`, a short description, an image and the `DXF file`. In the map select the location of your `WCS origin`, then enter the `Rotation` (angle with respect to True North). Eventually check `Private` to prevent other users from viewing your drawing. Press the `Save and continue` button. If all goes well the `DXF file` will be extracted and a list of `Layers` will be attached to your drawing. Each layer inherits the `Name` and color originally assigned in CAD. `ARC`, `CIRCLE`, `LINE` and `LWPOLYLINE` entities are visible on the map panel. It is possible to change layer name and layer entities. -If unnested `BLOCKS` are present in the drawing, they will be extracted and inserted on respective layer. Please notice that all entities forming the `BLOCK` will be placed on layer `0`. `Blocks` share the same model as `Layers`, so they can be modified in frontend. Insertion point is at (LAT=0, LONG=0). When updating a `Block` you will be able to access it's instances. Apart from normal CRUD operations, you can also `explode` an instance: the instance will be deleted, but it's entities will be transferred to insertion layer (this is common practice in CAD). +If unnested `BLOCKS` are present in the drawing, they will be extracted and inserted on respective layer. Please notice that all entities forming the `BLOCK` will be placed on layer `0`. `Blocks` share the same model as `Layers`, so they can be modified in frontend. Insertion point is at (LAT=0, LONG=0). When updating a `Block` you will be able to access it's instances. Apart from normal CRUD operations, you can also `explode` an instance: the instance will be deleted, but it's entities will be transferred to insertion layer (this is common practice in CAD). If you want to create a new `BLOCK`, make a `Layer` first. Layer can be transformed to block (an instance of the block will replace layer). ## On the frontend On the navigation bar look for `Projects/GeoCAD`. Two `List` frontend views are implemented: `List of all drawings`, `List by author`, where drawings are just markers on the map. Note that `private` drawings will be hidden from non authors in all views. Click on a marker and follow the link in the popup: you will land on the `Drawing Detail` page, with layers displayed on the map. If you are the author of this drawing, you can access all `CRUD` views for `Drawings`, `Layers` and `Insertions`. Note that all entities on a layer inherit layer color. ## Downloading In `Drawing Detail` view it is possible to download back the (eventually modified) `DXF file`. Some limitations apply: the `True North` will be respected, `ARC` and `CIRCLE` entities will be approximated to `LWPOLYLINES`, and `Layers` will have `True Colors` instead of `ACI Colors`. Beware that if layers have been modified and a download is performed, the stored file will be replaced too, and rotation will be set to zero (True North). +## Changelog v1.6.0 +* Transform layer to block +* C*UD views need permissions ## Changelog v1.5.0 * CRUD of block instances * Ability to switch single layers on/off in drawing detail view diff --git a/locale/it/LC_MESSAGES/django.mo b/locale/it/LC_MESSAGES/django.mo index 7da7860..970a6bd 100644 Binary files a/locale/it/LC_MESSAGES/django.mo and b/locale/it/LC_MESSAGES/django.mo differ diff --git a/locale/it/LC_MESSAGES/django.po b/locale/it/LC_MESSAGES/django.po index cb1bf8e..9c15917 100644 --- a/locale/it/LC_MESSAGES/django.po +++ b/locale/it/LC_MESSAGES/django.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-27 15:29+0100\n" -"PO-Revision-Date: 2022-11-27 15:32+0100\n" +"POT-Creation-Date: 2022-11-29 19:08+0100\n" +"PO-Revision-Date: 2022-11-29 19:10+0100\n" "Last-Translator: andywar65 \n" "Language-Team: \n" "Language: it\n" @@ -46,11 +46,11 @@ msgstr "Immagine" msgid "DXF file" msgstr "File DXF" -#: .\djeocad\models.py:63 .\djeocad\models.py:511 +#: .\djeocad\models.py:63 .\djeocad\models.py:564 msgid "Location" msgstr "Posizione" -#: .\djeocad\models.py:65 .\djeocad\models.py:513 +#: .\djeocad\models.py:65 .\djeocad\models.py:566 msgid "Rotation" msgstr "Rotazione" @@ -75,7 +75,7 @@ msgstr "Disegni" msgid "Layer / block name" msgstr "Nome del livello / blocco" -#: .\djeocad\models.py:403 .\djeocad\models.py:524 +#: .\djeocad\models.py:403 .\djeocad\models.py:577 msgid "Entities" msgstr "Entità" @@ -83,8 +83,8 @@ msgstr "Entità" msgid "Block definition" msgstr "Definizione del blocco" -#: .\djeocad\models.py:414 .\djeocad\models.py:438 .\djeocad\models.py:509 -#: .\djeocad\models.py:549 +#: .\djeocad\models.py:414 .\djeocad\models.py:491 .\djeocad\models.py:562 +#: .\djeocad\models.py:602 #: .\djeocad\templates\djeocad\htmx\insertion_inline.html:10 #: .\djeocad\templates\djeocad\htmx\layer_detail.html:4 #: .\djeocad\templates\djeocad\htmx\layer_inline.html:12 @@ -95,13 +95,13 @@ msgstr "Livello" msgid "Layers" msgstr "Livelli" -#: .\djeocad\models.py:436 .\djeocad\models.py:503 .\djeocad\models.py:551 +#: .\djeocad\models.py:489 .\djeocad\models.py:556 .\djeocad\models.py:604 #: .\djeocad\templates\djeocad\htmx\layer_inline.html:10 #: .\djeocad\templates\djeocad\includes\insertion_update.html:9 msgid "Block" msgstr "Blocco" -#: .\djeocad\models.py:442 .\djeocad\models.py:547 +#: .\djeocad\models.py:495 .\djeocad\models.py:600 #: .\djeocad\templates\djeocad\htmx\insertion_inline.html:9 #: .\djeocad\templates\djeocad\htmx\layer_inline.html:14 #: .\djeocad\templates\djeocad\includes\layer_update.html:10 @@ -109,11 +109,11 @@ msgstr "Blocco" msgid "ID" msgstr "" -#: .\djeocad\models.py:517 +#: .\djeocad\models.py:570 msgid "X scale" msgstr "Scala in X" -#: .\djeocad\models.py:521 +#: .\djeocad\models.py:574 msgid "Y scale" msgstr "Scala in Y" @@ -261,78 +261,86 @@ msgstr "Ancora nessuna istanza" msgid "Add instance" msgstr "Aggiungi istanza" -#: .\djeocad\urls.py:27 -msgid "/drawing//" -msgstr "/disegno//" +#: .\djeocad\templates\djeocad\includes\layer_update.html:49 +msgid "Transform layer to block" +msgstr "Trasforma livello in blocco" -#: .\djeocad\urls.py:32 +#: .\djeocad\urls.py:28 msgid "/drawing/add/" msgstr "/disegno/aggiungi/" -#: .\djeocad\urls.py:37 +#: .\djeocad\urls.py:33 +msgid "/drawing//" +msgstr "/disegno//" + +#: .\djeocad\urls.py:38 msgid "/drawing//update/" msgstr "/disegno//aggiorna/" -#: .\djeocad\urls.py:42 +#: .\djeocad\urls.py:43 msgid "/drawing//delete/" msgstr "/disegno//elimina/" -#: .\djeocad\urls.py:47 +#: .\djeocad\urls.py:48 msgid "/drawing//layer/add/" msgstr "/disegno//livello/aggiungi/" -#: .\djeocad\urls.py:52 +#: .\djeocad\urls.py:53 msgid "/layer//" msgstr "/livello//" -#: .\djeocad\urls.py:57 +#: .\djeocad\urls.py:58 msgid "/layer//update/" msgstr "/livello//aggiorna/" -#: .\djeocad\urls.py:62 +#: .\djeocad\urls.py:63 +msgid "/layer//to/block/" +msgstr "/livello//in/blocco/" + +#: .\djeocad\urls.py:68 msgid "/block//instance/add/" msgstr "/blocco//aggiungi/istanza/" -#: .\djeocad\urls.py:67 +#: .\djeocad\urls.py:73 msgid "/block-instance//update/" msgstr "/istanza//aggiorna/" -#: .\djeocad\urls.py:71 +#: .\djeocad\urls.py:77 msgid "drawing//download/" msgstr "disegno//download/" -#: .\djeocad\views.py:106 +#: .\djeocad\views.py:105 msgid "Drawing does not belong to User" msgstr "Il disegno non appartiene all'utente" -#: .\djeocad\views.py:177 .\djeocad\views.py:312 .\djeocad\views.py:394 -#: .\djeocad\views.py:408 +#: .\djeocad\views.py:180 .\djeocad\views.py:339 .\djeocad\views.py:425 +#: .\djeocad\views.py:441 msgid "Request without HTMX headers" msgstr "" -#: .\djeocad\views.py:203 +#: .\djeocad\views.py:206 msgid "Layer does not belong to User" msgstr "Il livello non appartiene all'utente" -#: .\djeocad\views.py:315 +#: .\djeocad\views.py:342 msgid "Can't delete layer '0'" msgstr "Non si può cancellare il livello '0'" -#: .\djeocad\views.py:318 +#: .\djeocad\views.py:347 #, python-format msgid "Layer \"%s\" deleted" msgstr "Livello \"%s\" eliminato" -#: .\djeocad\views.py:332 +#: .\djeocad\views.py:361 msgid "Layer is not a block" msgstr "Il livello non è un blocco" -#: .\djeocad\views.py:398 +#: .\djeocad\views.py:431 #, python-format msgid "Insertion \"%d\" deleted" msgstr "Inserimento \"%d\" eliminato" -#: .\djeocad\views.py:412 +#: .\djeocad\views.py:448 #, python-format msgid "Insertion \"%d\" exploded" msgstr "Inserimento \"%d\" esploso"