i am developing a web based application for showing the public vehicle routes using GeoServer, PostGIS and OpenLayers. what i need to do is let the user define a route by clicking on the main bus stop nodes on the map and i need to store those nodes of the route in my database. till now i have displayed the map and taken the user click inputs and got the coordinates where the user clicked. so now my problem is how to store those coordinate values in my database. i think this is where WFS-T comes in to transact the data between geoserver and the openlayers but i am not sure about it. am i suppose to use GML/KML to trasact the data.
Yes, you are right. You can use WFS-T to edit data in PostGIS via Geoserver. Here's an example of how it works.
Related
im creating a website using python flask, in the website the user should upload locatin, rate and add a description. im having trouble with finding a method that will let the user insert google map location to MySql database. can i use only my flask app and MySql database for doing that or i need php as well?
Thank You!
It depends on what sort of location you are looking for them to upload. If you are talking about an actual geographical location (ie a pin dropped from a Leaflet.js map) then you can store this in your database as two rows: latitude and longitude.
However, I suspect from your question that you instead want to identify a "place" (eg a restaurant, bar, hotel, park, landmark, house, etc) in which case lat/lon is a poor choice because there may be places which are very close to each other or on top of each other meaning you will have overlap; and you don't want a cluster of individual pins near to each other all referring to the same place.
In that case, you will want to look into something like Google Maps Place ID which assigns a unique identifier to each "place" on Google maps. For instance in your database you you could store a Place ID as a string of "ChIJFZo6iUSVwoARNU6w60iDGqY" (the In-N-Out Burger in Burbank California).
Other mapping services will have their own equivalents.
currently I would like to build an app for showing users' GPS coordinates. GPS data will be send through the POST to server and it will be store in database. From client side there will be input for typing username, then google map will appear with current user's position. I would like to build that app using React and Express+node, is it good idea? What will be the best way to do that? How can I send GPS data from server to react and generate it on map? Thanks for answers.
The hardest thing you have to solve is getting GPS data from map, and setting map position using GPS position you have from request.
Apart from that, you just can store GPS data on some DB, using Express+Node - that seems like a suitable solution.
You will just need DB connection, and a route, that handles POST(sending GPS coordinates), and GET(getting GPS coordinates) methods
I have a page where latitude, longitude can be saved by clicking on the map. Currently storing those values in my db.
I want to build a webpage where I want to show all saved places.
One answer I know is: retrive all records from db, and mark them on map.
This way also helps in filtering based on some fields in db. By the way, how to show radially, I mean, instead of loading all places at once, I think its good to do ajax requests to my db for places(lat, longitudes) available in that radial region showed by map, when we move the map, then we search in our db for places in that radial range and show only those places. this way, we need not load all(may be a million) saved places at a time. But how to do this? How can I fetch all records in my db whose lat, longitutes present in that radial range?
Another way: While saving in db itself, also save on map somehow so when that map is shown it will simply show that map which automatically shows saved places(saved in google maps server somehow).
Is this possible? even if possible, I think I cant filter(easily) based on fields in this way as they are shown directly by map. But, if possible to do, it can be used to show simply when not filtering.
What I need is the following.
Whenever I add any instance of object in my website, I need the server to add the location of the object to my own map either in Google maps or Bing maps (Bing maps docs are more clear therefore I'm going to use Bing).
Later, whenever I view the object in my site, the map should point to the location of the object and other my map objects in the same map.
How can this be achieved? Do I need to hold all the coordinates and object descriptions in my server, or somehow it is saved in the google or bing.
I went through the docs, but couldn't find any information I need.
You need to store them on your server and load them into the map on your webpage. There are ways with both google (fusion tables) and bing (spatial data services) of storing them with the provider but if you are already storing a copy for your website you are better off keeping them there for the map rather than maintaining two copies.
I'm not sure how technical you are but this best architecture approach is this:
1) Write a database query that finds objects to show on your map, ideally filtered by whatever the user can use to filter objects elsewhere on your site. Add to this query a filter by geographical bounding box (the range of latitude and longitude that can be seen on your map at any one point). The bounding box filter is just a simple sql BETWEEN clause but will mean you dont have to load every single object on to the map.
2) write a "webservice" that uses the database query in 1) and turns the results into JSON. This approach will lead to a much cleaner seperation between your mapping code in javascript and your server side code in the webservice.
3) Write your mapping frontend in Bing using javascript and use something like Jquery to read data from the webservice as the map is moved around re-load data that know should be shown on the new map view. As the data will be in JSON its much easier as JSON will just give you javascript versions of your objects
I want to create a web app that lets me create, store and display my travels. Something similar to this service here actually.
The basic structure/ideas:
create my trips by the following options
load a gpx
create a polyline (e.g. flight path)
create a route using google directions
Each trip consists of one ore several "stages" or "legs" that each can be creates like above
store the routes so that i can display them on a google map or edit them (draggable) later
So one map would then contain several "trips" that look like this
I have already read a lot about this matter and I think I should be able to handle the part about creating the routes, however when it comes to storing them I'm not sure if I have understood what's possible and how to do it.
My questions:
Storing: I was thinking to either convert each trip once it is complete to their own XML file containing all the required information such as waypoints and stages. Those file would be stored on my webspace and can then be parsed to display the trips at any time
I see a problem however when creating a leg using google directions: how can I store/retrieve such a leg and conserve the directions informations? It's rather easy as long as I don't change the route by dragging wayoints (I coudl simply store the start and end points and create it on the fly) however I would like to be able to edit them later, again by dragging the line. Would it be possible to extract all the additionally inserted waypoints to recreate the route later by using not only the start and end point but also those additional points (i.e. will google show me the same variation of the route?)
Is there any aspect that is against the terms of gmaps?
I could also use a mySQL database to store the information, is this the better approach?
BTW I am new to the whole gMaps API programming. My system is php based.
I would recommend you a mysql database to store the information. A directions is only a bunch of lat-long pairs, travel time, and polyon points. Usually I store it in a JS array but you can also use a Json or JS objects. I think you can serialize the array and store it in database. I would use xml only for configuration or formated output with xlst. The idea is also to store the lat-lng as points and use a spatial index on it to get faster search.