Convert OpenStreetMap POI Data to CSV - openstreetmap

I am looking to extract some Point of Interest (POI) data from OpenStreetMap in a tabular format. I have used this link navigated to the relevant country and downloaded the file,
http://download.geofabrik.de/
What I get is a file with the .osm.pbf extension. However, I think it is possible to download the files in other formats like .shp.zip and .osm.bz2. Is there some way that I can convert this data into a tabular format like a CSV file?
I came across a tool called Osmosis which can be used to manipulate data in these formats, but I am not sure if it can be used for this purpose,
https://wiki.openstreetmap.org/wiki/Osmosis
I was able to successfully install in on my Windows machine though.
To be frank, I am not even sure if this gives me what I want.
In essence, what I am looking for is Sri Lankan POI data that contains the following attributes,
https://data.humdata.org/dataset/hotosm_lka_points_of_interest
If the conversion of this file does not give me data in this format, then I am open to other approaches as well? What is the best way to go about acquiring this data?

Related

Can I use a sql query or script to create format description files for multiple tables in an IBM DB2 for System I database?

I have an AS400 with an IBM DB2 database and I need to create a Format Description File (FDF) for each table in the DB. I can create the FDF file using the IBM Export tool but it will only create one file at a time which will take several days to complete. I have not found a way to create the files systematically using a tool or query. Is this possible or should this be done using scripting?
First of all, to correct a misunderstanding...
A Format Description File has nothing at all to do with the format of a Db2 table. It actually describes the format of the data in a stream file that you are uploading into the Db2 table. Sure you can turn on an option during the download from Db2 to create the FDF file, but it's still actually describing the data in the stream file you've just downloaded the data into. You can use the resulting FDF file to upload a modified version of the downloaded data or as the starting point for creating an FDF file that matches the actual data you want to upload.
Which explain why there's no built-in way to create an appropriate FDF file for every table on the system.
I question why you think you actually to generate an FDF file for every table.
As I recall, the format of the FDF (or it's newer variant FDFX) is pretty simple; it shouldn't be all that difficult to generate if you really wanted to. But I don't have one handy at the moment, and my Google-FU has failed me.

Osmosis for OpenStreetMap data - fields lost when extracting data

I have downloaded a pbf file, france_latest.osm.pbf, from geofabrik.de and want to use osmosis to filter it to get a .osm file with just the major roads. Here is my osmosis command string:
osmosis --read-pbf france-latest.osm.pbf --tf accept-ways highway=motorway,motorway_link,trunk,primary,secondary,trunk_link,primary_link,secondary_link --used-node --write-xml roads_m_1ry_2ry.osm
This produces a .osm file with the correct items, but it does not contain any field information to distinguish the different types of highway so I can display them in different colours in QGIS. I did the same operation a few years ago and the field information was contained in the filtered export so I am not sure why it hasn't worked this time. Is there something else I need to add to my osmosis command to get the field information?
The highway type data was in the .osm file generated by osmosis. It seems the information was getting lost when I tried to convert the .osm to a .db spatialite file to load into QGIS. But with QGIS 3 you no longer need to do this, as you can import .osm files directly into a project.

Importing geospatial data into mongodb

I have found a source for geo data that represents a country, and its constituents. I am building a service where I would like to have a user select a country and then based on that country select an area they would like results from. I am trying to download the data and import it into MongoDB but I am unsure which file format is best to download, and what tools I will need to convert the data to import it. The file options are ESRI file geodatabase, Shapefile, R file, Google Earth (.kmz), Geopackage, and ESRI personal geodatabase. Which one do I choose and what tools do I need for the next step? Is this even the correct approach to having the collection of countries and their states/territories?
Here is the open source data
gadm.org
MongoDB uses a subset of the GeoJSON format for its geo-spatial data. I would look at which formats are closest to that. A quick web-search turned up this tool for converting kml files to GeoJSON.

Importing and exporting KML into and from DashDB for Geospatial Analysis

I am a recent convert to IBM's DashDB, and I considering proposing to use it at my work. My case would greatly be bolstered if I could show good, easy integration for geospatial analytics data, namely loading and performing SQL filtering on geodata currently in .shp or .kml formats. If it would be possible to also export the filtered data into a KML as a result that would be AMAZING.
So, to give a practical example, say I have an .SHP file with all the zipcodes in the US, I want to select the shape for the 02138 zip code and send it to the query-sender in KML format.
Does anyone have experience with that?
Loading .kml file directly to dashDB is currently not possible, as answered by another post here. You may use ArcGIS for Desktop to connect to dashDB if you want to do this.
https://gis.stackexchange.com/questions/141194/importing-and-exporting-kml-into-and-from-dashdb-for-geospatial-analysis
On the other hand, uploading a .shp file is natively supported and is demonstrated in this tutorial below. Note that dashDB requires the upload file to be compressed in .zip, .tar or .gz file formats.
https://www-01.ibm.com/support/knowledgecenter/SS6NHC/com.ibm.swg.im.dashdb.doc/tutorial/analyze-geospatial-data.html
Also, ArcGIS for Desktop should let you use its export features as well.
There are 2 options loading shape files: via the gui ("Load geospatial data") or via the CLPPlus command IDA LOADGEOSPATIALDATA .
Once the data is loaded it resides in the internal geometry format (e.g. as ST_Polygon), and can then be accessed in various formats through spatial functions imbedded in SQL calls. Unfortunately, kml is not one of the formats that dashDB supports as of now - options are GML, WKT, WKB.

Import data from Excel File to Core Data

I have thousands of students records in Excel sheet. Now I will import that all data into Coradata [from Excel sheet to Coredata] and I will create my iPhone application using that coredata.
I don't have any idea, how to import Excel file data into coredata.
You're thinking to broadly. You need to decompose this problem further. Here's your real problem:
How do I read an Excel file into memory?
How do I create Core Data objects?
"Excel" has nothing to do with "Core Data". They are entirely disjoint topics.
For the first question, there are several options. You could try and find a library that reads .xls or .xlsx files directly, or you could require that the file be in a different format (like CSV or something).
For the second question, that's easily answered by reading the Core Data documentation.
I would convert the file to xml.
There are plenty of codes showing how to parse xml.