There is an option within the Chrome dev tools which allows you to change your ubication (More Tools > Sensors). How does it work internally? Does it add an extra HTTP header indicating the GEO coordinates?
Yes, it changes the cookie that's sent with the request:
This is the cookie for Mountain View (California, Google HQ):
Cookie: UULE=a+cm9sZToxIHByb2R1Y2VyOjEyIHByb3ZlbmFuY2U6NiB0aW1lc3RhbXA6MTUyMjc1NDM1MDc1MjAwMCBsYXRsbmd7bGF0aXR1ZGVfZTc6MzczODYwNTIwIGxvbmdpdHVkZV9lNzotMTIyMDgzODUxMH0gcmFkaXVzOjkzMDAw
Discard the UULE=a+ and what you're left with is a Base64 encoded string. Decoding that becomes:
role:1 producer:12 provenance:6 timestamp:1522754350752000 latlng{latitude_e7:373860520 longitude_e7:-1220838510} radius:93000
Within that is the longitude and latitude, but I'm not sure what the other parts refer to. Guessing the radius is the radius from the centre of that long/lat (in metres?).
Hope that helps.
Related
(Please help I've been struggling with the same problem for more than three days...🤖)
I got GeoJSON file from National Statistical Office, which means it's official data- and the coordinates in this file look like this- :
[959394.1770449197,1948599.8772112513],
... ,
[1140386.5164449196,1684523.5489112514],
It's a GeoJSON object without a member named "crs", and as you can see, it's not using the WGS84 datum. Seems like it's coordinates to draw polygons, which are the shape of each district. I assume that there is no problem with data structure.
I tried to create map using this file with React Leaflet, but failed continuously. To find out if it's the problem of GeoJSON that I'm using, I used other GeoJSON files and it worked fine(meaning that interactive map was created on web) - By comparing the GeoJSON files, I found out that coordinates should be in WGS84 if I want to work with leaflet. So I tried to transform GeoJSON to WGS84 using reproject. In my react app project, I installed reproject, epsg and put the code below:
import * as mapData from '../data/sigunguWithPopGeo.json'
import { toWgs84 } from 'reproject'
import 'epsg'
let epsg = require('epsg');
toWgs84(mapData, undefined, epsg);
And the error was returned:
Error: Unable to detect CRS, GeoJSON has no "crs" property.
Thanks for reading this long intro - Finally here is my question.
Is there any way to reproject GeoJSON without "crs" property to WGS84? I also tried making the coordinates WGS84 with mapshaper.org. Again, I got the error caused by undefined coordinate system of GeoJSON file:
Unable to project -- source coordinate system is unknown
Should I consider adding crs property to GeoJSON? It's my very first time to create the interactive map using GeoJSON with React-leaflet, so any kind of advice from people who experienced similar projects would really help me!
Luckily, solved the problem by myself..!
Instead of keep looking for the methods to convert GeoJSON with undefined coordinate system to WGS84, I visited National Statistical Office's website to figure out the code of coordinate system that was used in src data - which was EPSG 5179. Then I converted GeoJSON file from EPSG 5179 to EPSG 4326(WGS84) on MyGeoData Converter. Before downloading the converted data, I checked on the map to see if the coordinates of data was successfully converted to proper lat, lng values. Hope this solution helps who are struggling with similar problems..👩🔧
I am using python and Beautiful soup to read html pages. Unfortunately some sites redirect to my Geo region (AU) so I can't retrieve the target countries version i.e. (UK, US, FR, NZ...)
I have tried using a VPN service but this requires me to manually change the region so I can't automate the process. I have tried using the python quartz.Coregraphics library to click the options on screen but this is temperamental.
Is there a way I can achieve this programmatically?
I have manage to nut this one out myself. Best answered by example for reading a uk based site.
import urllib2
url = 'Some-uk-url'
req = urllib2.Request(url)
req.add_header('Accept-Language', 'en-gb')
req.add_header('X-Forwarded-For', [a uk proxy ipaddress here])
htmltext = urllib2.urlopen(req).read()
I am developing an iOS Application for scanning QR Codes. I am successfully able to scan and get code from QR code.
Question:
My question is what are possible data types and format I can expect from QR Codes?
During my search on google I found QR Code can be used for
Contact data
Calendar data
URL
Email address
Phone number
SMS
Plain text
Geo location
Is this the complete list and is there same standard to represent above data in QR Codes? Means same way of generating QR Code for above QR types.
Is there any standard way of generating and representing data in QR Code?
Basically your text information has to be identifiable for what it is:
There is a very good summary here.
Contact data - use MeCard, or vCard (much more verbose), e.g.: MECARD:Surname, First;ADR:123 Some St., Town, Zip Code, Country;EMAIL:some_name#some_ip.com;TEL:+11800123123;BDAY:19550231;;
Gives:
Calendar data - There are two formats about iCalendar (.ics) & vCalendar (.vcs). These formats can also include location, alarm, to-do items, etc. Note that these are both verbose formats and you may be better off using a short URL to an online file in the file format but the person scanning needs to have internet connectivity and be willing to trust the QR code not to be doing anything bad.
URL: Start your url with the standard format specifier such as http://, e.g.: http://stackoverflow.com/questions/19900835/qr-code-possible-data-types-or-standards
Gives:
Email address - Start with mailto:SomeOne#SomeWhere.org gives:
Phone number - Start with tel: e.g. tel:+1-212-555-1212 gives:
SMS - See the RFC 5724.
Plain text - Just include the text.
Geo location - Use the geo:lat,long,alt format URI: geo:40.71872,-73.98905,100 (100 feet above Googles offices) gives:
WIFI - (ssid is 'abc' and password is '1234'). For WEP encryption: WIFI:S:abc;T:WEP;P:1234;;. For WPA/WPA2: WIFI:S:abc;T:WPA;P:1234;;. Without encryption: WIFI:S:abc;T:nopass;P:1234;;.
All the above example were generated with the Python qrcode package from the command line.
Basically, QR Code returns text data that can be of any type. You can put any type of data in any string format in QR Code. It totally depends on you.
You can consider it as
[NSString stringWithFormat].
Github - Zxing (Barcode Contents) has a summary.
There may or may not be a standard.
If you are looking for non-standard formats,
please update your documentation and contribute to open source.
I'd like to zoom in and out webpages using Firefox addon but I can't find anything in documentation addon docs. I'd like to make it work as Ctrl + mouse wheel or Ctrl + + / - but it should use my addon. Please help.
You need to access a browser element directly, in a way described in the full page zoom documentation. The high-level modules of the Add-on SDK don't provide this kind of access, you have to use the low-level modules to get to the browser windows. For example, to change the zoom level of the currently active tab you would do:
var {activeBrowserWindow} = require("window-utils");
var browser = activeBrowserWindow.gBrowser.selectedBrowser;
browser.markupDocumentViewer.fullZoom = 1.5; // 150%
Unfortunately, the window-utils module is largely undocumented. In addition to the activeBrowserWindow property it also provides a browserWindowIterator function that is useful if you want to manipulate tabs in all browser windows:
var {browserWindowIterator} = require("window-utils");
for (var window in browserWindowIterator())
doSomething(window);
ChromeWindow exposes a FullZoom object which allows to programmatically control zoom.
However I don't think you can reach it from the Add-on SDK.
Edit:
In light of Wladimir's answer, I would recommend the following
var {activeBrowserWindow} = require("window-utils");
activeBrowserWindow.FullZoom.enlarge();
activeBrowserWindow.FullZoom.reduce();
activeBrowserWindow.FullZoom.reset();
While you can't set arbitrary zoom factors, the bonus is that you get housekeeping for free, i.e. per site persistance of the zoom factor.
Check FullZoom at mxr
I am displaying multiple locations in blackberry using following code
String document="<location-document><location lon='-8030000' lat='4326000' label='Kitchener, ON' description='Kitchener, Ontario, Canada' /><location lon='-7569792' lat='4542349' label='Ottawa, ON' description='Ottawa, Ontario, Canada' /></location-document>";
MapsArguments map=new MapsArguments(
MapsArguments.ARG_LOCATION_DOCUMENT,document);
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS,
map);
It works fine.But i have to switch to another screen which displays location address when the user clicks particular location.Is it possible by using above code.If it is not possible how can do that.Please help me.
Thank you
I don't think you are going to be able to capture anything with that method. The problem is that when you call Invoke.invokeApplication you are actually telling the BB to launch and pass control to the BB Maps application. At this point, as far as I am aware, your app goes into the background and can not get any info from the BB Maps application. If you want to have control over the map, you should look into the MapField and/or RichMapField.