Realtime data streaming from LiveUAMap to ATAK/WinTAK - geolocation

Curious if anyone has ever attempted to connect LiveUAMap and ATAK or WinTAK?
I am currently assisting a group of medics who are on the ground helping civilians in Ukraine. I have been able to provide them with the geolocation of many events through ATAK - a tactical mapping interface. I have even been able to livestream open-source data created by independent mappers on Google My Maps. One solution I have not found however is how to connect realtime LiveUAMap data to ATAK. While LiveUAMap offers realtime geojson, I would need realtime KML because KML is the only file format allowed on the ATAK/WinTAk format.
Is anyone aware of if there are any viable ways to work around this issue? Would this require instant conversion from geojson to KML?

Related

Firebase & Swift: How to use another database for storing larger files?

I am currently trying to build a chat application in swift whilst using Firebase for real-time messaging. My only issue is I want users to send images, I want them to have profiles with images but I know Firebase has limited storage (or at least storage per pay tier is low for the number of connections you get)
So I would like to know how to connect up another database and make calls when needed between the two. So when and image is sent in a message, rather than Firebase storing the image, it stores a URL to the image in the other database.
I am under the impression something like AWS S3 is my best bet. any help is appreciated!
This question has been asked before and there are a number of solutions. It's kind of an 'opinion' type question but here are a few options.
View and store images in Firebase
Firebase has a 10Mb capacity, which is adequate for many images. However, if you need larger, they can be easily encoded as base64 and split into chunks.
If you want to go external:
s3 or Filepicker (Filestack) as well as Google provide some options.
Not sure of the overall requirements but obviously you can dig into CloudKit / CoreData and even Dropbox offers an API.
I have zero experience with Box but it may be an option as well.
Each option has it's own API.
In general, you would store a link in a firebase node to the image/object in question. However, the mechanics of that vary wildly as interfacing with CloudKit/CoreData will be different than say Filepicker.
With CoreData you will have to roll your own reference scheme whereas Filepicker you can have an almost direct reference to the file.
Many of these services provide a free or low cost tryouts and you can whip some code up in a manner of a few minutes to test out the functionality to see if it may meet your requirement.
If you need help encoding/decoding, see the answer to this question
Swift2 retrieving images from Firebase
Once you get rolling, if you have issues post some code in another question.

Adding many custom markers and many custom info windows in Google Maps SDK

I am really just looking for the best way to accomplish this. I've seen the code how to do these individually, but is there a away to do it for say, 100 points? Or do i need to set the custom image and custom info for every point I create?
Also, is there a backend, say SQLite, that i could incorporate the help accomplish more efficiently?
The app I'm building could have 1000's of points, and I REALLY wouldn't want to code everyone of those...but i would!
Thanks
Consider using Google Fusion Tables - they support 100,000 points per layer and 5 layers, for 500,000 points altogether. You access them via an SQL-type language that runs on Google's servers - exactly where your data will be when you upload it and that makes them very fast.
The infowindows are programmable too.
You load your CSV into a Fusion Table (like an Excel spreadsheet) in your Google drive and get a key to that table and you then use the key in your Javascript.
I created the following website with Fusion Tables and I don't have a clue about Javascript! See Skyscan website here. I won't mind if you click View Page Source :-) By the way, if you click on Modern Collections on that page, you are actually turning on/off 25,000 markers and it is almost instantaneous. There is also Marker Clustering available which lets you de-clutter maps with massive numbers of markers and automagically replace them with a single "fatter" marker.
There is a good tutorial here.

Mapkit. Getting nearby places from a server and possibly caching them (e.g. for offline use)

I am developing iOS 5 app which I want to communicate with server providing information about the nearby places for a given location: places locations and annotations. I want to use MapKit to populate my map with this information.
I didn't find any straightforward information regarding the following questions:
Does MapKit has tiles functionality (Google Maps way) out-of-the-box and do I need to work on it additionally, if not?
What is the best practice of retrieving places information (markers positions and annotations) from server?
Is it possible to cache this information so an user can see the nearby places of "his city" in offline mode?
Actually questions 2 and 3 are interrelated: they both address the problem of not retrieving an information (locations + annotations) that is already on map multiple times.
Hopefully I am not overlooking something obvious here.
Thanks!
Update 1: (Regarding places, not maps) More specifically I am interested in, how should I create a "hand-crafted" logical tiles for regions containing the places I fetch from the server, so they would not require refetching themselves when user scrolls the map? I know I can dive into implementing this functionality myself. For example, should I write the places just fetched to a local storage using Core Data immediately after fetching them or organize some queue? Or how could I know when I need to perform a request about the specific region on server and when I just fetch local data that is already on the device? I just want to know, are there any recommended approaches, best practices? Hopefully, I wrote it clear here.
Update 2: I am wondering about best practices here (links, example) not to start creating all this (points 2+3) from scratch. Are there any frameworks incapsulating this or good tutorials?
#Stanislaw - We have implemented the functionality you describe in an app called PreventConnect for one of our clients. The client already had some data stored out in a Google Fusion table. We extended their existing solution by adding another Google Fusion table which stores the geocoordinates for a number of locations. All this being said, to answer your questions...
1) The map portion itself is pretty out of the box, the tiles and what not, but you'll need to do some coding to get zoom extents, pin drops, annotations, and things like that working the way you expect them to work.
2) We found the Google Fusion solution to be quite effective. If you don't want to use Google Fusion there are other cloud database providers like StackMob, database.com, and many others. Google is free and they have an iOS SDK that makes communicating with Google Fusion pretty simple.
3) Absolutely! We cache much of the data in a Core Data store locally on the device. This greatly improves performance and responsiveness.
Time to write a solid answer to this my question (I could have it written a year ago but somehow I lost it from my mind).
Does MapKit has tiles functionality (Google Maps way) out-of-the-box and do I need to work on it additionally, if not?
The answer is yes: MapKit does have it. The keywords here are overlays (MKOverlay, MKOverlayView and others). See my another answer.
See also:
WWDC 2010 Session: Customizing Maps with Overlays,
Apple-WWDC10-TileMap.
What is the best practice of retrieving places information (markers positions and annotations) from server?
Actually since then I didn't learn a lot about "best practices" - unfortunately, nobody told me about them :( - that is why I will describe "my practices".
First of all, there are two strategies of populating a MapKit map with places:
The first strategy is about populating your map with the places by demand: imagine you want to display and see all places nearby (for example, no more than 1km from current user location) - this approach assumes that you ask your server only the places for the box you are being interested in. It means something like: "if I am in Berlin (and I expect 200 places for Berlin), why should I ever fetch the places from Russia, Japan, ... (10000+ places)".
This approach leads to relying on "tiles" functionality that question N1 address: Google maps and Apple maps are usually drawn using 'tiles' so for your "Berlin" portion of map you rely on corresponding "Berlin" tiles that are drawn by MKMapView - you use their dimensions, to ask your server only the places within the "Berlin" box (see my linked answer and the demo app there).
Initially this was the approach I've used and my implementation worked perfectly but later I was pushed to use second approach (see below) because the problem of clustering appeared.
The second strategy is to fetch all the places at once (yeah, all this 10000+ or more) and use Core Data to fetch the places needed for the visible portions of map your are interested in.
Second approach means, that during the first run you send your server a request to fetch all places (I have about 2000 in my app). Important here is that you restrict the fields you fetch to only geo-ones that you really need for your map: id, latitude, longitude.
This 'fetch-all' fetch has a significant impact on my app's first start time (On "the oldest" iPhone 4, I have near 700ms for the whole Fetch + Parse-JSON-into-Core-Data process, and extensive benchmarks show me that it is Core Data and its inserts is a bottleneck) but then you have all the essential geo-info about your places on your device.
Note, that whatever strategy you use, you should do a process of fetching these geo-points efficiently:
Imagine Core Data entity Place which has the following fields structure (preudo-Objective-C code):
// Unique identificator
NSNumber *id,
// Geo info
NSNumber *latitude,
NSNumber *longitude,
// The rest "heavy" info
NSString *name,
NSString *shortDescription,
NSString *detailedDescription, etc
Fetching places efficiently means that you ask only your place records geo-data from your server to make the process of this mirroring as fast as possible.
See also this hot topic: Improve process of mirroring server database to a client database via JSON?.
The clustering problem is out of scope of this question but is still very relevant and affects the whole algorithm you use for the whole proces - the only note I will leave here is that all the current existing clustering solutions will require you to use second strategy - you must have all the places prepared before you run into the clustering algorithms that will organize your places on a map - it means that if you decide to use clustering you must use strategy #2.
Relevant links on clustering:
WWDC 2011 Session: Visualizing Information Geographically with MapKit,
How To Efficiently Display Large Amounts of Data on iOS Maps,
kingpin - Open-source clustering solution: performant and easy-to-use.
Is it possible to cache this information so an user can see the nearby places of "his city" in offline mode?
Yes, both strategies do this: the first one caches the places you see on your map - if you observed Berlin's portion of map you will have Berlin part cached...
When using the second strategy: you will have all essential geo-information about your places cached and ready to be drawn on a map in offline mode (assuming that MapKit cached the map images of regions you browse in offline mode).

Geolocation, Is it possible to get latitude and longitude from address and store locally in my database

I want to be able to run queries locally comparing latitude and longitude of locations so I can run queries for certain addresses I've captured based on distance.
I found a free database that has this information for zip codes but I want this information for more specific addresses. I've looked at google's geolocation service and it appears it's against the TOS to store these values in my database or to use them for anything other than doing stuff with google maps. (If somebody's looked deeper into this and I'm incorrect let me know)
Am I likely to find any (free or pay) service that will let me store these lat/lon values locally? The number of addresses I need is currently pretty small but if my site becomes popular it could expand quite a bit over time to a large number. I just need to get the coordinates of each address entered once though.
This question hasn't received enough attention...
You're correct -- it can't be done with Google's service and still conform to the TOS. Cheers to you for honestly seeking to comply with the TOS.
I work at a company called SmartyStreets where we process addresses and verify addresses -- and geocode them, too. Google's terms don't allow you to store the data returned from the API, and there's pretty strict usage limits before they throttle or cut off your access.
Screen scraping presents many challenges and problems which are both technical and ethical, and I don't suppose I'll get into them here. The Microsoft library linked to by Giorgio is for .NET only.
If you're still serious about doing this, we have a service called LiveAddress which is accessible from any platform or language. It's a RESTful API which can be called using GET or POST for example, and the output is JSON which is easy to parse in pretty much every common language/platform.
Our terms allow you to store the data you collect as long as you don't re-manufacture our product or build your own database in an attempt to duplicate ours (or something of the like). For what you've described, though, it shouldn't be a problem.
Let me know if you have further questions about address geocoding; I'll be happy to help.
By the way, there's some sample code at our GitHub repo: https://github.com/smartystreets/LiveAddressSamples
http://www.zip-info.com/cgi-local/zipsrch.exe?ll=ll&zip=13206&Go=Go could use a screen scraper if you just need to get them once.
Also Microsoft provides this service. Check if this can help you http://msdn.microsoft.com/en-us/library/cc966913.aspx

Techniques for offline reverse geocoding on a mobile device?

I am working on a mobile mapping application (currently iOS, eventually Android) - and I am struggling with how to best support reverse geocoding from lat/long to Country/State without using an online service.
Apple's reverse geocoding API depends on Google as the backend, and works great while connected. I could achieve similar functionality using the Open Street Maps project too, or any number of other web services.
What I really want however is to create a C library that I can call even when offline from within my application, passing in the GPS coordinates, and having it return the country and/or state at those coordinates. I do not need finer granularity than state-level, so the dataset is not huge.
I've seen examples of how to do this on a server, but never anything appropriate for a mobile device.
I've heard Spatialite might be a solution, but I am not sure how to get it working on iOS, and I wonder if it may be overkill for the problem.
What are some recommended techniques to accomplish this?
Radven
You will need to get the Shapefiles (lat/lng outline) of all the administrative entities (US states, countries, etc). There are a lot of public domain sources for these. For example, the NOAA has shapefiles for US states and territories you can download:
http://www.nws.noaa.gov/geodata/catalog/national/html/us_state.htm
Once you got the shapefiles, you can use a shapefile reader to test if a lat/lng is within a shape. There are open source readers in C, just google. I seen stuff at sourceforge for shapefiles, but have not used these myself.
The Team at OpenGeoCode.Org
If you're looking for an approach based on a quadtree, try Yggdrasil. It generates a quadtree based on country polygon data. A Ruby example script can be found here.
I can suggest good written offline geocoding 3rd party library.
https://github.com/Alterplay/APOfflineReverseGeocoding

Resources