[Qgis-user] Python script for QGIS
Hi, I would need help ... I know how to do all the steps on the QGIS interface except one, the binarization of the png with the Raster calculator according to the RGB colors I have 524 288 png tiles to convert to kml, and even if I wanted to, it's an impossible task by hand ... so I would like to automate that. Here's what I've managed to do so far ... def run_script(iface): # 'map_11_' + str(column) + '_' + str(line) + '.png' for column in range(1023): for line in range(511): # Convert World Coordinate to GPS Coordinate def convWcToGps(column, line): # lonW var ulx = (360 * (column / 1024)) - 180 # latN var uly = 90 - (180 * (line / 512)) # lonE var lrx = ulx + 0.3515625 # latS var lry = uly - 0.3515625 return ulx, uly, lrx, lry # Verbose print ('map_11_' + str(column) + '_' + str(line) + '.png' + '\n lonW (ulx) = ' + ulx + '\n latN (uly) = ' + uly + '\n lonE (lrx) = ' + lrx + '\n latS (lry) = ' + lry) # Add GPS Coordinate and Projection # gdal_translate -a_srs EPSG:4326 -a_ullr input.png output.tiff 'gdal_translate -a_srs EPSG:4326 -a_ullr ' + str(ulx) + ' ' + str(uly) + ' ' + str(lrx) + ' ' + str(lry) + ' /Users/romain/TilesVR/map_11_' + str(column) + '_' + line + '.png /Users/romain/TilesVR/map_11_' + str(column) + '_' + str(line) + '.tiff' print ('Add Coordinate and Projection => DONE') # Binarisation # map_11_column_line.tiff to BIN_map_11_column_line.tif # 0 black = sea, 1 white = land # land = RGB 59,89,95,255 & RGB 60,89,96,255 # ? code print ('Binarisation => DONE') # Polygonisation # BIN_map_11_column_line.tif to POL_map_11_column_line.shp 'gdal_polygonize.py "/Users/romain/TilesVR/BIN_map_11_' + str(column) + '_' + str(line) + '.tif" "/Users/romain/TilesVR/POL_map_11_' + str(column) + '_' + str(line) + '.shp" -b 1 -f "ESRI Shapefile" POL_map_11_' + str(column) + '_' + str(line) + 'DN' print ('Polygonisation => DONE') # Repair geometry # POL_map_11_column_line.shp to RP_POL_map_11_column_line.shp # ? code print ('Repair geometry => DONE') # Linearisation # RP_POL_map_11_column_line.shp to LN_map_11_column_line.shp # ? code print ('Linearisation => DONE') # Export kml # LN_map_11_column_line.shp to KML_map_11_column_line.kml # ? code print ('Export Kml => DONE’) Would you be willing to help me ? Thanks ___ 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] Trend antivirus detects virus in QGIS in qgis-dev-bin-g7.exe.
Hello all, One of the frustrating problems is that we frequently get virus alerts related to TSC_GENCLEAN from Trend Micro antivirus. After a bit of research, I see that this alert is a common false positive. Has anybody seen this before? Btw, I've also seen alerts that say "Unauthorized File Encryption". And it seems to happen most when I either quit QGIS or QGIS crashes. Thank you, Bob ___ 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] QGIS2threejs not working
Hi there Same issue here. QGIS 3.4.13 under Windows 7, PC in a corporate LAN, (not administrator permissions) QGIS 3.10.1 under Ubuntu is fine. Carlos Cerdán El dom., 22 dic. 2019 a las 6:11, Paolo Cavallini () escribió: > Please use either 3.4 or 3.10 with a clean profile and report back. > Cheers. > > On 22 December 2019 12:28:26 EET, Velizar Strumberger < > velizar.strumber...@gmail.com> wrote: >> >> Hi >> I need some assistance. I finally decided to switch to GQIS 3.5. from >> QGSA 2.14 (historic decision for me).. Unfortunately the QGIS2threejs does >> not work. I have a DEM that works in QGIS 2.14 and 3D view but not here. >> When I upload the DEM the only thing I get is the blue sky canvas and a >> message: >> >> *No 3D objects were rendered? There is a compatibility issue with QGIS 3D >> view. You need to close QGIS 3D view(s) and restart QGIS to use this >> preview. * >> >> No! I did not start 3D view. The option Decorations dorks. The only thing >> that happens is "Building DEM .End. >> >> Thank you >> > > -- > Please excuse my brevity. > ___ > 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] Georeferencer
On 23/12/2019 09.12, Dave Gardiner wrote: > Hi Richard > > Thank you for helping. I confirm i followed the process in the webpage > except for ticking the no projection box. I opened the tif file in a new > QGIS project and the coords where lat/long = 0.0, 0.0 or there about. > The coords are correct in the tif.point file. The CRS for both QGIS and > Referencer were set to WGS84. Hi Dave, (please keep the conversation to the list) Then something went wrong. As I reckon you should have US or EU coordinates... (not 0.0).. What did you use as background map to reference your images too? Are you sure that maps is in WGS84 (as in: you see lat lon coordinates in the bottom bar of QGIS when you move the mouse?) and you see EPSG:4326 there? You can save the GCP file as a small txt file that should should show you your pixels from your image mapped to the coordinates in your desired crs. Else can you show that one to here? Start of with 'Transformation type' Linear: that means no rotation or warping of your image so if you click one or two coordinates, at least your map should be in more or less the right position and scale.. If that succeeds, try the other transformations. Just to be clear: you will not change your original image. YOu will get a new (geotiff) file named [originalname]_modified.tif and [originalname]_modified.tif.points (being the GCP if you checked save gcp points). IF you are georeferencing, do you see sane coordinates appear then in the table below the georefencing map? That is: pixel coordinates relating to world coordinates? > For other file formats > there is a 'world file' created [0]. Did you copy both your world file > AND the image? > > Where is the World file created, where do i find it and where do I copy > it to? Forget about that. I had a look in the plugin, and it always saves the output in geotiff format. A world file ALWAYS should sit next to the image it belongs to. If you want an example, just export the map canvas of QGIS to an image (png), QGIS will then create an worldfile next to it. (in the settings there is an option though to always create a world file, you could check that one and show us here too). Regards, Richard Duivenvoorde ___ 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