Tag Info

Hot answers tagged

5

I know your question is tagged with ArcGIS but I thought it might be interesting to describe an approach that almost solves this problem using R (which is opensource and free). The idea is that you load in any shapefile, and then loop through the list of polygons printing each one out as a png. It is quite quick to produce each png ( a few seconds) - not ...


4

Data Driven Pages. use the shapefile for your index layer. Set up your layout so that you have no margins and it is the size of the PNG you want. To export, follow the instructions and the bottom of this page under "How to export Data Driven Pages to other formats using ArcMap": ...


3

I would suggest you to go through their API documentation. Coming back to your question, you can iterate through all layers in the TOC using: canvas = qgis.utils.iface.mapCanvas() allLayers = canvas.layers() for i in allLayers: print i.name() #Do other stuff here.


3

Images > Adjustments > Levels > Click Auto! Or just 'Ctrl + L'. You may need to adjust the levels to auto twice to get a more desirable results (not just for hillshades). The first time you press Auto, the results can be quite dark/saturated. Doing that a second time lightens things up. But seeing as you only have two values, black or white, this may get ...


3

Try this: d.mon start=png d.rast RASTER d.vect VECTOR d.mon stop=png This will basically render VECTOR layer on top RASTER layer to a file called map.png. Other things you could do with d.mon start=png - d.mon stop=png: Type d.erase to wipe the slate clean before committing with d.mon stop=png Include the legend with d.rast.leg: d.mon start=png ...


3

Avances, The output of ST_AsPNG is the binary blob of a PNG file, so you output it to a file as you would any other binary document saved in PostgreSQL . It really depends what you are using as your tool. For example we have examples of this that output to browser in thsese quick examples we put together to demonstrate how it is done. ...


2

The easiest way to do it would be to use Geoserver/GeoWebCache with MS SQL Server extension. Unfortunately, you will not get PNG files with quadkey as you aspect, but you get a service that can server tiles as a WMS-C/TMS standard which shouldn't be to difficult to implement into your application. Also it has possibility to re-render particular tiles as you ...


2

Further to Mike's answer, gdal_translate has the -ot switch to force a given datatype (-ot Byte in your case), and the -mask switch to select a band as a mask, e.g.: -mask 4 My ImageMagik-fu isn't strong, but an alternative is if you can get IM to just output the rectangle it would have used to trim the image, you could use the -srcwin option of ...


2

Just a wild guess for the 16 bit pixels issue: you can try forcing 8-bit or byte pixels in convert by using png8:trimmed.png as the output filename. If you are using precompiled Windows binaries, you can download the "Q8" releases, which uses byte computations only.


2

This looks like a perfect use-case for GeoServer. I guess Mapserver would also fit you needs. I've personally build something similar to make a printable version of an OpenLayers powered map. This map was displaying complex data coming from GeoServer on top of Google base maps (WMS protocl was used between OL and GeoServer). What I did was simply to ...


2

Well, on my own, I finally dug out the key function I needed: setSubsetString(). Whoever named this thing?...doesn't seem very intuitive as to its function. Here's the skeleton I'm working with now: qgis.utils.iface canvas = qgis.utils.iface.mapCanvas() allLayers = canvas.layers() for n in range(1, 201) for layer in allLayers: ...


1

I've used imagemagick's mogrify command to fix transparency for GoogleEarth, but my source images came from other software. mogrify -type TrueColorMatte -background "black" -transparent black file.png These options may also help -format png32 -depth 8 -type TruecolorMatte -define png:color-type=6


1

Another alternative (avoiding the TOS issue) would be to use OSM (as suggested by Geoist). That would be really simple, because you can easily work a position / offset position to a pixel offset into the image using the formula given at http://wiki.openstreetmap.org/wiki/Zoom_levels You could still use PIL as I suggested in my other (proposed) answer.


1

A world file (pgw) consists of width of pixel rotation about Y axis (nearly always 0) rotation about X axis (nearly always 0) negative height of pixel (to make the maths easier) left edge (in the real world) top edge (in the real world) so in your case it should be something like: 5.364583333333333e-6 0 0 -5.364583333333333e-6 -43.475647 -22.871114 ...


1

The general workflow would be something like this: Try saving your AI vector as a dxf file. This can be converted with a tool like ogr2ogr to a gis format such as a shapefile (or another vector gis format). You will then have to georeference that resulting shapefile (not sure what would be the best tool here - I'd look to qgis first). After that is done, ...


1

There are quite a few ways to do this, it really depends what sort of user-interaction you want. The simplest option would be to use the HTML <map> element. There are lots of online tutorials on it, but a couple results (including examples) to get you started: http://www.htmlcodetutorial.com/images/images_famsupp_220.html ...


1

I recommend using Python to script a solution. I'd try to georeference the png corners to the corresponding polygon envelope or bounding rectangle corners. This can be accomplished with gdal_translate -gcp and gdal_warp. The resulting shape image in the geotiff may not perfectly overlay the polygon shape, but should be close.



Only top voted, non community-wiki answers of a minimum length are eligible