[Qgis-user] Export raster with display name using graphical modeler

2019-06-04 Thread Rebecca Bennett
Hello everyone,
I have created a model to automate cropping and renaming a series of raster
images (using their new origin co-ordinates as the display name), however I
am unable to work out how to export the resulting rasters to new files with
their layer display name as the file name.

e.g. raster 0046_clip.tif has the display name 27_367000 automatically
created by the model and I need to automatically export this to a raster
using the display name as its name (ie not right click export as).

Any ideas most welcome - I'm sure I'm missing something really simple!

Thanks for reading,
Rebecca 



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Is location info included in metadata when save an image file?

2019-06-04 Thread Kirk Schmidt

Ert:

With a jpg or png file, the coordinate data are stored in the world file 
(a simple text file with the pixel x gsd , rotation,pixel y gsd, x 
coordinate, top left, y coordinate top left - see sample below).  For a 
pdf, the coordinate data is stored within the pdf and you would have to 
check the geo-pdf specs to see where they are stored.  If you write a 
geotiff, the coordinates will be contained withing the file header.


Sample tiff world file (*.tfw)

0.025000
0.00
0.00
-0.025000
674643.3881379978
4945024.4282323727

Kirk

On 6/4/2019 1:48 PM, Alex M wrote:

Nyall,

I just did a test like Kirk png and jpg do not contain EXIF coordinates.
For the purposes of this discussion the original poster wants to know
which formats drop the location data, and it appears jpg and png are
safe for that purpose. I would advise that not every format will behave
the same, as we all seem to agree a tiff from the Image Save should have
the location in it's metadata. Though I know a good way to strip that
out - GIMP or Photoshop, open & export usually kills all metadata,
command line Photography tools might also (e.g. imagemagick).

Tested with QGIS 3.4

Thanks,
Alex

On 6/3/19 16:16, Nyall Dawson wrote:

On Tue, 4 Jun 2019 at 09:13, Fernando M. Roxo da Motta  wrote:

On Mon, 3 Jun 2019 11:01:06 -0300, Kirk Schmidt
 wrote:



Hi Ert:

You can save locational data in jpg and pdf files from within the
Print Composer window.  Under composition tab on the right hand side
of the window, scroll down and check the Save World File checkbox.
Export your map/composition as a jpg or pdf and the geolocation data
will be written to a world file for a jpg and internally for a pdf.

   Just to be sure that I understood it correctly.   If I save as jpg
the geolocation information will be only written to the world file if I
check the Save World File checkbox.   That means that, regardless to
check or not that checkbox, the jpg image will not contain any
geolocation information.

   Is that correct?

Incorrect. It will always be embedded directly inside the image
metadata where possible. The "create world file" checkbox only
controls whether an external text file with the referencing
information is also created.

Nyall




Good luck

Kirk Schmidt

On 6/2/2019 4:26 AM, Ert Four wrote:

Thank you Alex and Roxo for your replies.

  From what I can tell the SVG and JPG files probably don't have
location info in them, but it's also hard to tell what exactly the
data is in some places, especially in the SVG.

It looks like qgsmaprenderertask.cpp was written two years ago,
which was after 2.14 came out.

I will post on the developer list per Alex's suggestion. All of
this is trying to prove that something doesn't exist -- which is
always hard.

Thanks again.



On June 1, 2019 at 4:41 PM "Fernando M. Roxo da Motta"
 wrote:


On Thu, 30 May 2019 17:09:59 +0200 (CEST), Ert Four
<4...@mailbox.org> wrote:



Does any coordinate or location data get embedded in the image
file if I use Project > Save as Image or Composer > Export as
Image/PDF/SVG?

I'm using QGIS version 2.14.3 Essen, although I would like to know
about more recent versions, too, for when I upgrade later.

(I'm aware of the option to check "World file on" and create a
separate world file. What I need is to make sure there is no
identifying info whatsoever from the project file in the image
file itself.)

Eg, say I have a basemap like OpenStreetMap open for a country
and I load points in another layer that are inside that country.
Then I zoom in on a group of points from my data layer, I turn
off the basemap layer, and make a map with just my data points. I
want to preserve the relative spatial relationships between my
points but not reveal where in the world the map came from. If I
publish this image file, might the metadata reveal the location?

For the work we do, it's critically important we not unknowingly
publish specific locations.


AFAIK, if you save in PNG or JPEG format no coordinate
information is stored in metadata of the image:

$ exiftool Inhambu.jpg
ExifTool Version Number : 10.80
File Name   : Inhambu.jpg
Directory   : .
File Size   : 49 kB
File Modification Date/Time : 2019:06:01 11:37:04-03:00
File Access Date/Time   : 2019:06:01 11:37:04-03:00
File Inode Change Date/Time : 2019:06:01 11:37:24-03:00
File Permissions: rw-r--r--
File Type   : JPEG
File Type Extension : jpg
MIME Type   : image/jpeg
JFIF Version: 1.01
Resolution Unit : inches
X Resolution: 96
Y Resolution: 96
Image Width : 917
Image Height: 665
Encoding Process: Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components: 3
Y Cb Cr Sub Sampling: YCbCr

Re: [Qgis-user] Is location info included in metadata when save an image file?

2019-06-04 Thread Alex M
Nyall,

I just did a test like Kirk png and jpg do not contain EXIF coordinates.
For the purposes of this discussion the original poster wants to know
which formats drop the location data, and it appears jpg and png are
safe for that purpose. I would advise that not every format will behave
the same, as we all seem to agree a tiff from the Image Save should have
the location in it's metadata. Though I know a good way to strip that
out - GIMP or Photoshop, open & export usually kills all metadata,
command line Photography tools might also (e.g. imagemagick).

Tested with QGIS 3.4

Thanks,
Alex

On 6/3/19 16:16, Nyall Dawson wrote:
> On Tue, 4 Jun 2019 at 09:13, Fernando M. Roxo da Motta  wrote:
>>
>> On Mon, 3 Jun 2019 11:01:06 -0300, Kirk Schmidt
>>  wrote:
>>
>>
>>> Hi Ert:
>>>
>>> You can save locational data in jpg and pdf files from within the
>>> Print Composer window.  Under composition tab on the right hand side
>>> of the window, scroll down and check the Save World File checkbox.
>>> Export your map/composition as a jpg or pdf and the geolocation data
>>> will be written to a world file for a jpg and internally for a pdf.
>>
>>   Just to be sure that I understood it correctly.   If I save as jpg
>> the geolocation information will be only written to the world file if I
>> check the Save World File checkbox.   That means that, regardless to
>> check or not that checkbox, the jpg image will not contain any
>> geolocation information.
>>
>>   Is that correct?
> 
> Incorrect. It will always be embedded directly inside the image
> metadata where possible. The "create world file" checkbox only
> controls whether an external text file with the referencing
> information is also created.
> 
> Nyall
> 
>>
>>
>>>
>>> Good luck
>>>
>>> Kirk Schmidt
>>>
>>> On 6/2/2019 4:26 AM, Ert Four wrote:
 Thank you Alex and Roxo for your replies.

  From what I can tell the SVG and JPG files probably don't have
 location info in them, but it's also hard to tell what exactly the
 data is in some places, especially in the SVG.

 It looks like qgsmaprenderertask.cpp was written two years ago,
 which was after 2.14 came out.

 I will post on the developer list per Alex's suggestion. All of
 this is trying to prove that something doesn't exist -- which is
 always hard.

 Thanks again.


> On June 1, 2019 at 4:41 PM "Fernando M. Roxo da Motta"
>  wrote:
>
>
> On Thu, 30 May 2019 17:09:59 +0200 (CEST), Ert Four
> <4...@mailbox.org> wrote:
>
>
>> Does any coordinate or location data get embedded in the image
>> file if I use Project > Save as Image or Composer > Export as
>> Image/PDF/SVG?
>>
>> I'm using QGIS version 2.14.3 Essen, although I would like to know
>> about more recent versions, too, for when I upgrade later.
>>
>> (I'm aware of the option to check "World file on" and create a
>> separate world file. What I need is to make sure there is no
>> identifying info whatsoever from the project file in the image
>> file itself.)
>>
>> Eg, say I have a basemap like OpenStreetMap open for a country
>> and I load points in another layer that are inside that country.
>> Then I zoom in on a group of points from my data layer, I turn
>> off the basemap layer, and make a map with just my data points. I
>> want to preserve the relative spatial relationships between my
>> points but not reveal where in the world the map came from. If I
>> publish this image file, might the metadata reveal the location?
>>
>> For the work we do, it's critically important we not unknowingly
>> publish specific locations.
>>
>AFAIK, if you save in PNG or JPEG format no coordinate
> information is stored in metadata of the image:
>
> $ exiftool Inhambu.jpg
> ExifTool Version Number : 10.80
> File Name   : Inhambu.jpg
> Directory   : .
> File Size   : 49 kB
> File Modification Date/Time : 2019:06:01 11:37:04-03:00
> File Access Date/Time   : 2019:06:01 11:37:04-03:00
> File Inode Change Date/Time : 2019:06:01 11:37:24-03:00
> File Permissions: rw-r--r--
> File Type   : JPEG
> File Type Extension : jpg
> MIME Type   : image/jpeg
> JFIF Version: 1.01
> Resolution Unit : inches
> X Resolution: 96
> Y Resolution: 96
> Image Width : 917
> Image Height: 665
> Encoding Process: Baseline DCT, Huffman coding
> Bits Per Sample : 8
> Color Components: 3
> Y Cb Cr Sub Sampling: YCbCr4:2:0 (2 2)
> Image Size  : 917x665
> Megapixels

Re: [Qgis-user] Forms, realtions and foreign keys

2019-06-04 Thread Karl Magnus Jönsson
Thanks. Works perfect. I  missed the "initially deferred" in the FK.

Karl-Magnus

Från: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] För Matthias Kuhn
Skickat: den 4 juni 2019 11:27
Till: qgis-user@lists.osgeo.org
Ämne: Re: [Qgis-user] Forms, realtions and foreign keys


Hello,

If you enable "evaluate default values server side" and "automatic transaction 
groups" and set the foreign key check in the database to initially deferred 
you'll get pretty much what you want :)

Hope that helps

Matthias
On 6/4/19 11:14 AM, Karl Magnus Jönsson wrote:
Hi list!
I have a project with tree tabels stored in PostGIS. One is holding the 
geometry the other two is holding data related to the first table as child and 
grandchild. I have set up foreign keys between the tables in the database to be 
sure that there will be no orphan records. In QGIS there are relations and 
(sub)forms. When I digitize a new geometry I get the new id from the database 
(before it's saved, OK) in the form but I can't add any children. I get a 
database error that says that there are no parent with that ID (and that's 
true). I have to  press OK to create the feature in QGIS, change tool to 
identify, find the feature and klick on it to open the form again. Then I can 
add children. But I haven't saved so there is still no parent. But it works 
then. It's the same with the grandchild table but then the grandparent form is 
still open so it's not such a big problem. Anyone got a better way to skip this 
closing and reopening of the form in the workflow?

Karl-Magnus Jönsson | Gis-Utvecklare
Geografisk information
Miljö- och samhällsbyggnadsförvaltningen
Kristianstads kommun
Besöksadress: Västra Storgatan 12
Postadress: 291 80 KRISTIANSTAD
Telefon: 044-135416 | Mobil: 0733-135416
E-post: 
karl-magnus.jons...@kristianstad.se
www.kristianstad.se

Läs mer om hur vi hanterar dina personuppgifter på 
www.kristianstad.se/personuppgifter




___

Qgis-user mailing list

Qgis-user@lists.osgeo.org

List info: https://lists.osgeo.org/mailman/listinfo/qgis-user

Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] exporting layout to pdf changes output of locked maps

2019-06-04 Thread Harrissou
Hi,
That should have worked without map themes, too.
1- Set the main map canvas to aerial photo, refresh the print layout (should be 
optional), lock one of the map items
2- Set the main map canvas to topo maps now, refresh the print layout (again 
should be optional but will show whether the locking works), lock the second 
map item.
3- Export

If that doesn't work, then there might be an issue worth reporting.

Regards,
Harrissou

Le 4 juin 2019 11:02:41 GMT+02:00, Reginald  
a écrit :
>Hi,
>
>Using a different map theme works!
>Good to know.
>I'm still a little bit puzzled why the locking didn't work.
>
>Regards,
>
>
>
>
>--
>Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
>___
>Qgis-user mailing list
>Qgis-user@lists.osgeo.org
>List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma 
brièveté.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Forms, realtions and foreign keys

2019-06-04 Thread Matthias Kuhn

Hello,

If you enable "evaluate default values server side" and "automatic 
transaction groups" and set the foreign key check in the database to 
initially deferred you'll get pretty much what you want :)


Hope that helps

Matthias

On 6/4/19 11:14 AM, Karl Magnus Jönsson wrote:


Hi list!

I have a project with tree tabels stored in PostGIS. One is holding 
the geometry the other two is holding data related to the first table 
as child and grandchild. I have set up foreign keys between the tables 
in the database to be sure that there will be no orphan records. In 
QGIS there are relations and (sub)forms. When I digitize a new 
geometry I get the new id from the database (before it’s saved, OK) in 
the form but I can’t add any children. I get a database error that 
says that there are no parent with that ID (and that’s true). I have 
to  press OK to create the feature in QGIS, change tool to identify, 
find the feature and klick on it to open the form again. Then I can 
add children. But I haven’t saved so there is still no parent. But it 
works then. It’s the same with the grandchild table but then the 
grandparent form is still open so it’s not such a big problem. Anyone 
got a better way to skip this closing and reopening of the form in the 
workflow?


*Karl-Magnus Jönsson*| Gis-Utvecklare
Geografisk information
Miljö- och samhällsbyggnadsförvaltningen
Kristianstads kommun
Besöksadress: Västra Storgatan 12
Postadress: 291 80 KRISTIANSTAD
Telefon: 044-135416 | Mobil: 0733-135416
E-post: karl-magnus.jons...@kristianstad.se 


www.kristianstad.se 

Läs mer om hur vi hanterar dina personuppgifter på 
www.kristianstad.se/personuppgifter 




___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Forms, realtions and foreign keys

2019-06-04 Thread Karl Magnus Jönsson
Hi list!
I have a project with tree tabels stored in PostGIS. One is holding the 
geometry the other two is holding data related to the first table as child and 
grandchild. I have set up foreign keys between the tables in the database to be 
sure that there will be no orphan records. In QGIS there are relations and 
(sub)forms. When I digitize a new geometry I get the new id from the database 
(before it's saved, OK) in the form but I can't add any children. I get a 
database error that says that there are no parent with that ID (and that's 
true). I have to  press OK to create the feature in QGIS, change tool to 
identify, find the feature and klick on it to open the form again. Then I can 
add children. But I haven't saved so there is still no parent. But it works 
then. It's the same with the grandchild table but then the grandparent form is 
still open so it's not such a big problem. Anyone got a better way to skip this 
closing and reopening of the form in the workflow?

Karl-Magnus Jönsson | Gis-Utvecklare
Geografisk information
Miljö- och samhällsbyggnadsförvaltningen
Kristianstads kommun
Besöksadress: Västra Storgatan 12
Postadress: 291 80 KRISTIANSTAD
Telefon: 044-135416 | Mobil: 0733-135416
E-post: 
karl-magnus.jons...@kristianstad.se
www.kristianstad.se

Läs mer om hur vi hanterar dina personuppgifter på 
www.kristianstad.se/personuppgifter

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] exporting layout to pdf changes output of locked maps

2019-06-04 Thread Reginald
Hi,

Using a different map theme works!
Good to know.
I'm still a little bit puzzled why the locking didn't work.

Regards,




--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] exporting layout to pdf changes output of locked maps

2019-06-04 Thread Reginald
hi Karl,

I will try that and report back.
thanks for the tip

Regards,



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] exporting layout to pdf changes output of locked maps

2019-06-04 Thread Karl Magnus Jönsson
Hi!
Have you tried to create different map themes and associate them with the 
appropriate layout map frame?

Karl-Magnus Jönsson 

-Ursprungligt meddelande-
Från: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] För Reginald
Skickat: den 4 juni 2019 09:50
Till: qgis-user@lists.osgeo.org
Ämne: [Qgis-user] exporting layout to pdf changes output of locked maps

Hello users and devs,

I've been trying to create a A1 maplayout containing two A2 maps.
One of the maps I put on the layout shows an aereal photo, the other shows a
topographical map on another scale.
When my layout was ready I locked all the items and clicked on the export to
pdf icon.
The result is that both maps on the layout get refreshed and the pdf shows
the same topographical map in each A2 map window.
Is it not posible to use two different maps in one layout?
I tried different strategies but no luck.
I'm using the latest version of QGIS on windows 7 (OSGeo4W).

Regards,



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] exporting layout to pdf changes output of locked maps

2019-06-04 Thread Reginald
Hello users and devs,

I've been trying to create a A1 maplayout containing two A2 maps.
One of the maps I put on the layout shows an aereal photo, the other shows a
topographical map on another scale.
When my layout was ready I locked all the items and clicked on the export to
pdf icon.
The result is that both maps on the layout get refreshed and the pdf shows
the same topographical map in each A2 map window.
Is it not posible to use two different maps in one layout?
I tried different strategies but no luck.
I'm using the latest version of QGIS on windows 7 (OSGeo4W).

Regards,



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user