Tag Info

Hot answers tagged

12

Rasters are images, so the best format will be an image format (png/jpg/etc). Geojson is a good format for vectors. You will never see, say, your facebook profile pic be transported back as pure json. Of course, returning a url to an image as json is very very different :) As far as the jpeg vs png vs any other image format discussion, there are tons of ...


7

No, that won't work. Geoserver is expecting an SLD, so it will fail parsing any PHP code you insert there. What you can do is generate the SLD outside of Geoserver and pass it over when requesting the map from Geoserver. In OpenLayers it works like this: var sld = '<StyledLayerDescriptor version ="1.0.0" ...> more xml here ...


7

You can store your data in a database (Fusion Tables is a quick solution). Google Maps has a tutorial that shows you how to do this with MySQL (but can be any database) http://code.google.com/apis/maps/articles/phpsqlajax_v3.html You can get as secure and obfuscated as you want using a database back-end. Looks like you geocode your data on the fly - you ...


7

Download the source code from here http://www.osola.org.uk/elevations/index.htm SRTMGeoTIFFReader.php is the clever file the reads the GeoTiff and converts the elevation values (in meters) into Lat/Lng coordinates. I doubt this is exactly what you want but it does give you a solid base on understanding the process required to accomplish the task from your ...


6

Mehul, I work in the address verification industry with a company called SmartyStreets. There are lots of geocoding services out there, but only few will support batch processing with the volume you require. (Google and others don't permit bulk use of their API or storing/caching results.) If you go to your MySQL database and perform an export of your table ...


6

Rather than using convert, could you try to use gdal_translate to convert the png to tiff and then georeference it using gdal_warp (assuming you've created a tfw file for the tiff)?


5

You make mistake in loadMarkers function: if(jsonData.markers[i].limpio == 0) var icon = new OpenLayers.Icon('redMarker.png',size,offset); if(jsonData.markers[i].limpio == 1) var icon = new OpenLayers.Icon('greenMarker.png',size,offset); After that icon variable is undefined. You should explode this variable before if statement var icon; ...


5

If you like Python, you could use the GeoPy API, combined with the GDAL Python bindings or Fiona, and create a very basic script like this for converting the addresses to a point shapefile. This will geolocate a file named 'addresses_to_geocode', creating an output shapefile named 'my_output.shp': import os from geopy import geocoders from osgeo import ...


5

First you'll need to set up MapServer as a WMS, then you'll need a tile cache to produce the tiles and store them. This guide should get you started with that. Then only real catch is that Google think the Earth is round and made up their own projection so you'll need to serve your tiles in epsg:900913 but most (all?) the tile caches mentioned in the above ...


5

'n' is almost always used to denote the number of items in a dataset (ie the number of people who participated in a survey or the number of animals counted). I would venture to guess that in this case it represents the number of tiles present at a given zoom level. However, without more information about precisely what you are trying to accomplish it is ...


5

This depends on what you want & need. Do you only need "dead" bitmaps, or do you need "alive" objects in your client? There are numerous solutions out there, depending on your needs. You need a client in your browser, OpenLayers is perhaps the most prefered open source solution. As for the service backends, e.g WMS and WFS, Geoserver and Mapserver ...


5

Your generated GeoJSON is valid JSON, no problem. But, it's not valid GeoJson, as you can see here: http://geojsonlint.com/ The problem seems to be that the features-array in your featurecollection contains three features, two with geometry:none and one with just geometry (which is also string-encoded). So, in short: Your OpenLayers-code seems fine, the ...


5

This only a partial answer and lacks all python but too long to fit into a comment field. Your data is rather easy to convert into WKT: capture the coordinate part switch commas to spaces and spaces to commas close inside WKT polygon: POLYGON ((...)) POLYGON ((39.655756 -4.034769,39.655757 -4.034769,39.655758 -4.034769,39.655800 -4.034788,39.655885 ...


4

Mapserver has support for postgis rasters and directions for a basic setup are given here (item 9.9). In your case you would setup Mapserver to work as a WMS server so that it returns the Postgis rasters as normal WMS layers. It is then almost trivial to add the layers into your OpenLayers map by using a WMS layer object. This kind of solution is probably ...


4

George, I think your premises are a little confused. You say you want to build a "WMS file", but WMS isn't a file. WMS stands for "Web Map Service", which is any program that conforms to the WMS Specification. There are two pieces to the WMS: a client, and a server. The client requests images according to the specification, while the server sends the ...


4

You won't be able to actually hide the contents of popup_content and address from the user, simply because anything that is sent to a web page is plainly visible to the end-user. Instead of dumping it all at load-time though, you can do an async request for it on a map click. In your click handler function you would want to make a request from the PHP page ...


4

Try changing your Polygon WKT to this (note the extra parens): POLYGON((50.866753 5.686455, 50.859819 5.708942, 50.851475 5.722675, 50.841611 5.720615, 50.834023 5.708427, 50.840744 5.689373, 50.858735 5.673923, 50.866753 5.686455)) That's off the cuff and I haven't tried it yet, but well-formed WKT for Polygons has to support both the outer and inner ...


4

Do you know the extents of the image? If you know the bounding coordinates of the image you can us gdal_translate with the -a_srs (this assigns the projection) and -a_ullr (this is the bounding coordinates). I have used this to convert .jpg of sonar images from a low cost fishing sonar unit to geotiffs.


4

A quick solution to serve up shapefiles on a basemap in a webapp is through a free arcgis.com account. They allow you upload .shp files, symbolize, and lay them on a base map. The share tool allows provides a html script that can be copied. I served up some symbolized counties to my blogger page in a webmap. Note that ESRI is trying to monetize arcgis.com ...


4

If you want to make browser download the generated KML, an extra header is needed: header("Content-Disposition: attachment; filename=MY_KML_FILENAME.kml"); Otherwise, just ignore the message, it's harmless. Chrome doesn't recognize the KML-specific Content-Type, and expects ordinary text/xml or application/xml, but since it's all XML, it should be parsed ...


4

Since your search region is circular, it is perhaps best not to consider it to be a polygon, but as a point with a radius and to use the ST_DWithin() function: ST_DWithin — Returns true if the geometries are within the specified distance of one another. It should save you and the processor a lot of effort.


3

Unfortunately this is not documented in the api reference or samples. But here is the gist of it. First create the store: POST /rest/workspaces/<ws>/wmsstores <wmsStore> <name>wms</name> <capabilitiesURL>http://somehost/wms?</capabilitiesURL> <workspace>sf</workspace> </wmsStore> And then ...


3

Use your GDAL's Fusion Table driver to load your shapefiles into Google Fusion Tables. The GFT developer docs are pretty self explanatory. You can then use standard php code (even in your shared hosting environment) to write your webapp. If you want more functionality, you are going to have to move to something where you have more control of your ...


3

Geoserver REST API can be constructed using Path GET (read) POST (create) PUT (update) DELETE (delete) http://geoserver.org/display/GEOS/User+Collaboration+REST+API for selecting a SLD you need to GET {yourserver} {port} {user} {password} /geoserver/rest/styles (exists already in rest api) This might help for you too ...


3

Here's the complete code for reading through SDF: <?php session_start(); require_once '<your path>/common.php'; try{ $args = ($_SERVER['REQUEST_METHOD'] == 'POST')? $_POST : $_GET; $sessionId = $args['SESSION']; $mapName = $args['MAPNAME']; MgInitializeWebTier ($webconfigFilePath); $userInfo = ...


3

Here's a code snippet I found online that parses PHP URL variables into JavaScript. You may have to modify it a little to fit your needs, but it's pretty short and simple: http://papermashup.com/read-url-get-variables-withjavascript/


3

This is just a tile server, its purpose is just to serve tiles. You will need a mapping application to access the tiles, something like OpenLayers, Google Maps, LeafletJS. You then tell your mapping API to use tileserver.php to get tiles at the address described in the documentation at github. Github Readme You should never have to directly access ...


3

In php and many other languages the pow(a,b) or power(a,b) function raises a to the b power, or multiples a by itself b times. pow(2,3) equals 8. In your case the higher the zoom level the larger N is.


3

I think it's the number of tiles. its value is calculated by powers of two. For example, when zoom level is 0, n = 1, when zoom level is 1, n = 2, when zoom level is 2, you get 4 titles, and so on. That means when map is zoomed in larger, map is divided by more tiles.


3

1) If you want to create a shapefile for download, you should be able to publish an async geoprocess that will return a link to the location of the generated shapefile on your ArcGIS Server. You call this service from the javascript API using esri.tasks.Geoprocessor. Take a look at the clip-and-ship example. It uses a file gdb, but you should be able to ...



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