OSM - Offline query for my IONIC/CORDOVA project - javascript

I'm pretty new to OSM (OpenStreetMap). I'm developing a cross platform mobile application with IONIC/CORDOVA.
I want to save OSM data in my database. Is to possible to save osm data in SQLite? Or anything better than SQLite for this project such as JSON? If it is possible then how can I manipulate/query data from there?
Thank you in advance.

You can export OSM data to lots of formats, and you can save that data in a database. However, you cannot use PostGIS in SQLite so you have to come up with your own query system.
If you already have a (semi) working system using PostGIS I'd suggest implementing a (web) API to serve the data to your app from a database running on a server instead of trying to bundle all needed data and do the querying on a mobile phone.
Alternatively if the app uses data that can be precomputed you could run the queries using PostGIS and bundle the result with your app. (In GeoJSON, CSV, KML, ... format)
This is of course dependent on the type of data and queries that you need - if you extend your question to include that I might be able to give a more specific answer.

Related

Fetching data from DynamoDB using node js

I have an application related to catalog of APIs, now I wanted to have a html page where it should display usage analytics like No of users registered with the application, No of API’s, etc.
i wanted to host this page on AWS and the data related to users and APIs will be stored in DynamoDB. I want to retrieve this information into my application using nodejs.
What should i do exactly to achieve this, any references would be helpful.

How to embed my Machine-learning R code in a website

I need to run my R-code through a website, with the user giving feature values from the website itself, which I have to use as new data for prediction in the R-code. How can I do it?
Have a form on the website which performs an HTML post to a REST api on your web server which will write the information to a database such as MySql, Postgres, MongoDB, or any other database of your choice. Then use a DBMS database management system (DBMS) such as MySQL Workbench, pgAdmin, or Robomongo to query the database and put the data into a csv file, and run your R-code on it. Then use the parameters from your machine-learning model on your server to serve content.
You can expose any R code as a REST API using packages such as plumber, OpenCPU or RestServ. Such an API can then be integrated into the website using Jacascript.

Best way to get and store data (optimized) to mobile app (Ionic, Cordova/Phonegap)

I want to do an app with ionic framework and cordova for Android and iOs and I want to optimize at most the requests to the server.
I need to get data from php server (API) and store in the mobile phone, this data is related, so I think that a SQLite is the best option to store it in the device because of to show it is more fast to do a complex SQL than get a JSON stored in localstorage (for example) and search and link the data in the mobile. I'm right?
I need to do this and can do a Pull to refresh in the app and get only new data.
I've been watching some solutions but I don't know what is the best.
Parse/Firebase: This is difficult to administrate for non-specialists, for this I have a backend to enter and modify data with the relations easily. In addition this services return a JSON with more data that I need.
Persistence.js and Persistence.sync.js this works with mysql-server and sqlite-local but can I sync only one table or get only the new data? And I did't find a solution for php server.
CouchDB and PouchDB: I don't know if this can be sync only for a new records.
Receive data in JSON and store it in SQLite: I need to create functions to do this easier.
Any other solutions?
I'm very lost in this topic.
Thanks!!
CouchDB and PouchDB: I don't know if this can be sync only for a new records.
That’s the default. Plus they handle all the nasty sync details for you. Would highly recommend looking into this.

How to show sqlite data on HTML5

I have a local sqlite database, and a lightweight mini-httpd server on the same linux host.
I'd like to provide web visualization of the data contained on the sqlite database.
I've checked Google Charts and it basically does what I need, but doesn't directly connect to sqlite. Should I feed the data manually with javascript?
What is the best way for showing result of sqlite queries to a web browser?
If you want to show statistic with Google Charts you have to provide the data with a proper format.
You need an app where to make request and connect to the DB running on the webserver, make the query with javascript to that app and then pass the data to G charts.
You have also tons of libraries to show data, all you have to know is the licence your site will be running. jchartfx if really powerfull

Android data transfer between apps and website

I have build a website which provide a lot of data and based on some rules of company, I can't directly get the data from database for my app version. The only way to do it is to use a webview to show the previous website, but I want to get some data reference to the website for my app processing.
I would like to get an values call productID from the website and use it to save as a record into the mobile local database. This saving move will run in the Android app. Is there a way to do this?
It there a way to get data from the website? Is JavaScript possible for this case?
Just a few words to Google for you. Just look out for a REST API for you Server (you can write it in PHP) to give the data in JSON to your app.
Use GSON in your app to get the JSON object to a Java object. And keep in mind to do all network calls in a thread/async task. You can have a look at the Volley library provided by Google.
Have fun with your Project ;) Step by step, and you will get it!
Tutorial

Categories