MKMapview Coordinates UTM32 - iphone

I´m getting coordinates from a JSON feed, I get them in UTM32. Does anyone know how I can convert these into latitudes and longitudes so I can display them in my mapview ?
Ex: "Lat": 597355,
"Lng": 6643184,

Here is a small library in Java:
UTM32_converter
It's the result from converting a JavaScript found here: Geo UTM

I'd suggest using a library such as PROJ or GeographicLib to do the conversion from UTM to latitude/longitude. You might also consider GDAL, but the UTM conversion API is basically a wrapper for PROJ, and it's a pretty large library that's probably overkill for simple conversions.

Related

Wireshark shows plain number in place of longitude and latitude values

I am facing issue with coordinate calculation (Longitude and Latitude). I have a pcap file when I open it with Wireshark I am getting the packet as shown below -
Latitude: 52.5125915 (52°30'45.33"N) (525125915)
Longitude: 13.3335368 (13°20'00.73"E) (133335368)
But when I am copying the value manually or exporting the pcap into a JSON file I am getting the value as (525125915).
So I need to know how to convert the value into "Decimal Degrees" format.
Note:
I have searched for conversion options but all the articles I found refer to "DD to DMS" or "DMS to DD" conversion but I could not find any formula / documents to convert a number to coordinate degree.
I have also tried converting the number to degree but it will not work for above case!
Thanks in advance.
Shahneel
I have found a workaround for most of the sites they are doing it like following example -
int(val)/10000000.0
For 525125915/10000000 it is now showing as 52.5125915
Thanks

Flask Restplus : Sending DateTime as a parameter [duplicate]

Let's say that I have following parser inside my get method:
from flask.ext.restful import reqparse
parser = reqparse.RequestParser()
parser.add_argument('when', type=datetime, help='Input wasn\'t valid!')
And then I want to test the said get method with curl...
curl --data "when=[WHAT SHOULD I WRITE HERE?]" localhost:5000/myGet
So the question is, how I should call the get method? I've tried numerous different formats, tried to read rfc228 standard, etc. but I can't figure out the right format.
Kinda late, but I've just been in the same problem, trying to parse a datetime with RequestParser, and sadly the docs are not so helpful for this scenario, so after seeing and testing RequestParser and Argument code, I think I found the problem:
When you use type=datetime in the add_argument method, under the hood it just calls datetime with the arg, like this: datetime(arg), so if your param is a string like this: 2016-07-12T23:13:3, the error will be an integer is required.
In my case, I wanted to parse a string with this format %Y-%m-%dT%H:%M:%S into a datetime object, so I thought to use something like type=datetime.strptime but as you know this method needs a format parameter, so I finally used this workaround:
parser.add_argument('date', type=lambda x: datetime.strptime(x,'%Y-%m-%dT%H:%M:%S'))
As you can see in this way you can use whatever format datetime you want. Also you can use partial functool instead of lambda to get the same result or a named function.
This workaround is in the docs.
Just an update on Flask-Restful (0.3.5): it is possible to use the own library date and datetime functionality parsing, if ISO 8601 or RFC 822 suffices:
from flask_restful import inputs
parser.add_argument('date', type=inputs.datetime_from_iso8601)
So the request would be,
curl --data "date=2012-01-01T23:30:00+02:00" localhost:5000/myGet
From the docs

How to convert .nm2 to .osm

How can I convert Navitel map format .nm2 to default Open Street Map format .osm?
I know the osmconverter but it doesn't provide this kind of functionality.

Facebook API: How to get the conversion pixel values for an ad

How can I read the values for a conversion pixel via Facebook API v2.4?
From what I read (and tried) you can't get it via the Insights API and the Reporting API is deprecated.
I want to read the following values:
actions_28d_click:offsite_conversion.checkout - Checkouts
(Conversion Pixel) [28 Days After Clicking]
actions_28d_view:offsite_conversion.checkout - Checkouts
(Conversion Pixel) [28 Days After Viewing]
actions_28d_click:offsite_conversion.registration - Registrations
(Conversion Pixel) [28 Days After Clicking]
actions_28d_view:offsite_conversion.registration - Registrations
(Conversion Pixel) [28 Days After Viewing]
Probably this might help you:
https://www.facebookmarketingdevelopers.com/samples/adsreporting
You need to query the Insights-API. That sample script above is retrieving values for the "28d-click"-attribution window.
You need to change or extend the if-clause and the params-dict accordingly.
Thanks for clarifying.
No, it's not possible to retrieve these values using the Public API. These values are reported by Power Editor and Ads Manager only.

Parse.com: set Date as data type not current date

I have Date data and converted to string "2014-04-16 08:27:52" from my local PostgreSQL.
Please explain me how to set it at Parse.com as Date datatype?
In the docs on rest API search on date and see the json type and format :
"__type":"Date","iso":"2011-08-21T18:02:52
That would be Included in the date elements json used in the post.
I just figured it out:
var date = new Date("2014-04-16 08:27:52");
object.set("last_update",date);
In PHP, you can do:
$parse->someDate = $parse->dataType( 'date', '1985-01-01' );
In JavaScript, you can do:
var someDate = new Date("1985-01-01");
yourclass.set( 'someDate', { "__type": "Date", "iso": someDate.toISOString() } );
For Parse.com and PHP, the answer is less straight forward than what is presented here. It took me a while to figure out that dataType() isn't working for some reason in the SDK.
It seems many people got the $parse->dataType() syntax from here. But I can't find this function anymore in the official SDK.
Then there is this bug and the resulting function from StackOverflow, but neither of these are very user friendly.
As it turns out, the Parse PHP SDK will handle an array for the value in the createdAt, updatedAt, and other special data types.
This code works (essentially a direct port from their REST API / JavaScript):
$query->greaterThanOrEqualTo("createdAt", ["__type" => "Date", "iso" => date('Y-m-01\TH:i:s')]);
Feel free to use that format for other special types, like GeoPoints.