How persist geo coordinates - bigdata

I am making a app that récord geo coordinates from a gps phone. Later with these geo coordinates i will show the route in a map.
What is the best way to persist this info? Which Database do you recommend?
I am asking this question because for big trips, the geo coordinates are going to be to much records, and is going to impact in performance.
Any help will appreciated.
Cheers

A database might be just needed if you want to other things with coordinates.
There several solutions available:
Postgresql with PostGIS (opensource)
Oracle with Oracle Spatial
Microsoft SQL Server with Spatial extension
SQLite (Spatialite)
You can combine them with output systems e.g.
geoserver
mapserver
ArcGIS Online
QGIS
...
To display your routes.

Related

what is the best possible ways to share map data among multiple spring mvc application?

I don't have sound knowledge of caching. my requirement is that i want to access a map data that should be sharable among multiple spring mvc application.Please let me know best possible solution.
note[map data will be heavy i.e big in size]
To share a big map, you can use a couchdb and share reference between applications.
Following are the reasons suggested:
If you are planning on transferring big maps the mapping at source and destination is going to cost you transactions and computing.
Instead a caching dB which stores only the map will help you reduce burden.

Should I use JanusGraph as main database to store all my data for a new project?

I'm thinking about learn JanusGraph to use in my new big project but i can't understand some things.
Janus can be used like any database and supports "insert", "update", "delete" operations so JanusGraph will write data into Cassandra or other database to store these data, right?
Where JanusGraph store the Nodes, Edges, Attributes etc, it will write these into database, right?
These data should be loaded in memory by Janus or will be read from Cassandra all the time?
The data that JanusGraph read, must be load in JanusGraph in every query or it will do selects in database to retrieve the data I need?
The data retrieved in database is only what I need or Janus will read all records in database all the time?
Should I use JanusGraph in my project in production or should I wait until it becomes production ready?
I'm developing some kind of social network that need to store friendship, posts, comments, user blocks and do some elasticsearch too, in this case, what database backend should I use?
Janus will write data into Cassandra or other database to store these data, right?
Where Janus store the Nodes, Edges, Attributes etc, it will write these into database, right?
Janus Graph will write the data into whatever storage backend you configure it to use. This includes Cassandra. It writes this data into the underlaying database using the data model roughly outlined here
These data should be loaded in memory by Janus or will be read from Cassandra all the time?
The data retrieved in database is only what I need or Janus will read all records in database all the time?
Janus Graph will only load into memory vertices and edges which you touch during a query/traversal. So if you do something like:
graph.traversal().V().hasLabel("My Amazing Label");
Janus will read and load into memory only the vertices with that label. So you don't need to worry about initializing a graph connection and then waiting for the entire graph to be serialised into memory before you can query. Janus is a lazy reader.
Should I use Janus in my project in production or should I wait until it becomes production ready?
That is entirely up to you and your use case. Janus is being used in production already as can be seen here at the bottom of the page. Janus was forked from and improved on TitanDB which is also used in several production use cases. So if you wondering "is it ready" then I would say yes, it's clearly ready given it's existing uses.
what database backend should I use?
Again, that's entirely up to you. I use Cassandra because it can scale horizontally and I find it easier to work with. It also seems to suit all different sizes of data.
I have toyed with Google Big Table and that seems very powerful as well. However, it's only really suited for VERY big data and it's also only on the cloud where as Cassandra can be hosted locally very easily.
I have not used Janus with HBase or BerkeleyDB so I can't comment there.
It's very simple to change between backends though (all you need to do is adjust some configs and check your dependencies are in place) so during your development feel free to play around with the backends. You only really need to commit to a backend when you go production or are more sure of each backend.
When considering what storage backend to use for a new project it's important to consider what tradeoffs you'd like to make. In my personal projects, I've enjoyed using NoSQL graph databases due to the following advantages over relational dbs
Not needing to migrate schemas increases productivity when rapidly iterating on a new project
Traversing a heavily normalized data-model is not as expensive as with JOINs in an RDBMS
Most include in-memory configurations which are great for experimenting & testing.
Support for multi-machine clusters and Partition Tolerance.
Here are sample JanusGraph and Neo4j backends written in Kotlin:
https://github.com/pm-dev/janusgraph-exploration
https://github.com/pm-dev/neo4j-exploration
The main advantage with JanusGraph is the flexibility of pluging-in whichever storage backend you'd like.

What is a LAU2 level admin boundary shapefile available via a persistent URL (for reproducible research)?

I'm writing up some research in .Rmd and am trying to set this up as reproducible research, that is in a form which can be executed and recompiled by other users. Towards this end, I'm looking for a shapefile with LAU2 level administrative boundaries (i.e. local parishes) that can be downloaded directly to R (using something, as shown below such as getURL) via a persistent URL (ideally from a reliable repository), something like what I've done for my own POI data:
ecs <- read.csv(text=getURL("http://datashare.is.ed.ac.uk/bitstream/handle/10283/1943/ECS-GIS-Locations_2.9_simplified.csv"))
The OS BoundaryLine data would be great, except that it sits behind a request form that has to be filled out and then a download URL is provided via email. GADM and Natural Earth are terrific resources, but AFAIK don't provide parish or county-level boundaries. Can anyone recommend an alternative, but nonetheless canonical / reliable alternative?

Countries and their province web service

I need a webservice to get information of whole of the countries and their provinces location and area or population is anyone who knows this web service ?
why you need web service? I don't think so its exist.
what you need to do is, you can create table in your DB and add data, Its easy to find SQL insert queries to dump the data. please check these URLs
http://amrelgarhytech.blogspot.com/2008/08/list-of-countries-cities-languages.html
Country, state list for SQL Server
You can also use the great service from the chaps at http://www.geonames.org/
I did a small tool to generate an XML file based on the output of their webservices: https://github.com/yosoyadri/GeoNames-XML-Builder
All credit should really go to the C# library at http://geonamesdotorgdotnet.codeplex.com/ that I'm using to parse the response XML from the services.
You have an already made list of countries and provinces at https://raw.github.com/yosoyadri/GeoNames-XML-Builder/master/continents-countries-statesprovinces.xml
As Muhammad I think it is always good practice to keep your local copy of the data rather than querying the service everytime.

How to get distance from Google Map API from server side ASP.NET 2.0

I am working on a project which requires a server side access to google map api. i want to calculate distance (actual distance, not straight line). google map api supports javascript and not asp.net. please give suggestions ...!
you specified google maps in your question - but have you looked at Virtual Earth? Specifically this routing with Virtual Earth Web Service example sounds exactly like what you want:
server-side access (just Add Service Reference inside visual studio)
actual distance (not straight line) since it is using a route
The concerns raised by others about T&Cs for 'internal/intranet use' apply to VE as well as Google I think - you'll have to read up about whether your application needs licensing or not.
p.s. if you did just want to calculate straight-line distance, I have instructions using SQL Server 2008; which also links to some straight c# code that does it too.
The Google API allows you to Geocode via a server side call:
http://code.google.com/apis/maps/documentation/services.html#Geocoding_Direct
This would allow you to get the longitude and latitude of the locations. You can then cache these and use them to calculate distance using the techniques CMS suggests.
You will need to be careful of the Google T&C's though as you are only allowed to store the geocoding data for use on a Google map which is publicly available.
You would probably also run into limitations on the number of requests you could make from a single IP.
However I think what you mean by non-straight line distance is distance taking into account roads and one way streets etc.
If this is the case I think a commercial service is your only option. Although theoretically you could do it all via screen scraping, I'm almost certain that this would break Google's T&C's.
The simplest solution would probably be just to embed a Google map on a page of your application and let the user calculate the distance. You could pre-fill the to and from fields if required.
Again if this is for an internal app i.e. Not publicly available "my understanding" of the Google T&C's would forbid this.
Use something like firebug or fiddler to look at the requests that are being sent to Google from javascript you should then beable to build the request using that information and an HTTPWebRequest in .net and retrieve the same information.
HTH
You can calculate the distance of two geographical coordinates (latitude, longitude) using the Great-circle distance algorithm.
Here you can find some other formulas for distance calculation.
Well, you've pretty much identified the key issue, the Gmaps API is a browser resident javascript API and there's not much getting around that. Most of the API is executed in the browser so there's not much network traffic to spy on.
As tsaunders mentions there is a geocoding API call that is restfully accessible, but it only does reverse/geocoding and if you have lat/lng's already you can use the calculations the rms suggested, but they are as tsaunders points out 'as the crow flies' distance.
If indeed you are looking for road taken distance, the API does do routing but you are back in the browser to get the start/end points from the user.
Perhaps you can be a little more specific about what you are trying to do and why you feel this requires you to to access the API from your server. My application for instance has features that gather information from the user and sends requests back to my server to work on, some of that data are processed by the Gmaps API first.
If I were to use a API platform, I certinaly would not use Google as the free one does not include advances Geocoding menaing the accuracy is poor. There is also no sla , support or rights of service.
The directions are poor, the coverage for Ireland and Geocoding is almost childlike and the privacy stinks. No professional business would use a google mapping solution.
They copy everyone else's idea, say they are there own and get loads of press (they only added tube stations in 2006) an dcyclc lanes (2010), viamichelin added these 2006 and Traffic in 2009 !
Any agency or developers looking for an API should stick to Bing or ViaMichelin for better customisation and user experience which is killer !

Resources