Tag Info

Hot answers tagged

9

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

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 ...


6

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

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 ...


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

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 ...


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

'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 ...


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

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 ...


3

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 ...


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

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

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 ...


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

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 ...


3

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.


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

The answer to your question is subjective (a matter of opinion) so it might be voted down (-1). Since your new to this site, I will go ahead and answer -- mapserver, open layers and postgis sql would be a very good combination for an open source solution. Geoserver is also an option instead of mapserver -- it is java based. There are also other javascript ...


2

There is no explicit documentation but you could explore the source code into the offcial plugin repository to know how it works. Note that, the plugin is for sf1.3 / 1.4 versions but it does not exist for sf 2. Mapfish uses REST, so you will find some valid documentation also on that page : http://trac.mapfish.org/trac/mapfish/wiki/MapFishProtocol (From ...


2

You can do this in PHP if you'd like or any other Server-Side language. Here is the SCHEMA. However, you're going down a long bumpy road wanting to do it yourself. If you already have the relational database use something like GeoServer, MapServer or ArcGIS Server to expose that database in the wms format. It will do all the hard work for you. Geoserver ...


2

First of all: your original question is bad. You will may get inconsistensies if 2 users are using the file at the same time and your mysql server is suddenly responding slower or not at all, which may mean that properties are added to the wrong id. It may therefore be better to add all data to mysql, including the spatial data. There is an FDO provider ...


2

If you want to factor-in more accurate driving distances, I recommend pitching-out to a free service already providing these sort of metrics like Google's or MapQuest's. Google's seems to rightly-check for crazy inputs. I tried getting driving directions from Boston, MA, to Malé, Maldives, and the service replied it could not connect the two; it's possible ...


2

This is a high-level answer as you've not given any specifics. Reading KML is basically the same as XML (KML being a subset thereof). Some possible resources: http://stackoverflow.com/questions/8342337/parse-kml-file-with-php http://www.boards.ie/vbulletin/showthread.php?p=71913675 http://web.stefanproell.at/wp/2010/01/parsing-kml-files-with-php/ Then ...


2

This a really a duplicate of your previous question, and my answer is the same. Don't mix SQL and WKT! Use ST_MakePoint if you need to embed parameters into an SQL statement. $sql = 'INSERT INTO app(p_id, p_fname, p_lname, p_saddr, p_caddr, the_geom) ' . 'VALUES(intval($p_id), $fname, $lname, $street, $city, ST_SetSRID(ST_MakePoint($long, $lat), 4326))'; ...


2

it works under PHP 4, PHP 5. beside this you can use passthru command too.. passthru command execute an external program and display raw output. exec — Execute an external program Description string exec ( string $command [, array &$output [, int &$return_var ]] ) exec() executes the given command. there is an example here. but they are ...


2

You just need to have the proper connection to the database. IE SQL Sever / Postgres. If the data is already in ArcSDE it is probably easier to create a service and publish it. However, since you mentioned reusing code you just need to call the php file in your page. Look at ...


2

reg 1: If you have a PostGIS DB you can query the geometry of the layer say, city_points. the query is SELECT city_name from city_points where the_geom = asText('your input wkt) this can be of something like 'POINT(10.5,78.3)'. you can easily make wkt string that way. reg 2: KML is an open standard and is an XML format. you can find OGC specs here. Also ...


2

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/


2

If you're using mapbox.js directly, you can call map.ui.hash.add() (assuming your map variable is named map), and the page will have a hash like #10.00/45.5342/-73.7457 which encodes the zoom level, latitude, and longitude of the map position, and you can send users to URLs like that to set the initial map position.



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