how to convert GIS DMS coordinates - node.js

I know this is a very wide subject - still - I would like to convert a GIS DMS coordinates, for example:
33° 0' 10'' , 33° 40' 30''
into an EPSG:3857 format, ie:
3689865.02422557637, 3212878.5986975324
(this is not the calcualated convert, just an exmaple of the formats).
I know there are calculations\conversions in Map suppliers (ESRI, etc.). I'm looking for either of these ways, if somehow possible:
nodejs module (proj4js ? I looked in it but couldn't find a way doing so).
asp.net core FW feature\nuget ?

Yeah, proj4js can do this. First convert your DMS coordinates into decimal degrees, then tell proj4js to convert from WGS-84 to EPSG:3857.
Happily, proj4js ships with this conversion, so you don't have to look for the datum strings online.
const proj4= require("proj4");
// TODO: that's not the correct conversion of the original DMS to decimal degrees :)
console.log(proj4("WGS84", "EPSG:3857", [33.01, 33.4]));
outputs
[ 3674656.3910859604, 3948518.4270993923 ]

Related

ZPL: RFID, Combining Field Data (^FD) and Field Numbers (^FN)

I am attempting to encode the EPC of a GS1 RFID using ZPL statements on a Zebra 410R printer.
First, consider the following ZPL :
^FD51,0,6,111111,2,33,444^FS
What I am attempting to do, is replace the 444 with a value stored in a field number (^FN).
^XA
^DFE:RFID^FS
^RB96,8,3,3,20,24,10,28
^RFW,E
^FD51,0,6,111111,2,33,^FN11"Enter Barcode"^FS
^XZ
So, How do I replace the '444' portion of the field data with the value stored in the field number (^FN11) ?
Thank you in advance.
Well, maybe a little bit too late, but to anyone, who may have the same question - DF is a pair command, you need to pair it with XF. DF is Download format - here you use the varible ( FD, FN). XF is Recall Format - here you declare the variables.
So, your code just miss the definition of variable, here is the whole code:
Your code:
^XA
^DFR:RFID^FS
^RB96,8,3,3,20,24,10,28
^RFW,E
^FD51,0,6,111111,2,33,^FN11"Enter Barcode"^FS
^XZ
^XA
^XFR:RFID
^FN11^FN444^FS
^XZ

How to display '.cgal' File generated by CGAL:mcfskel

I'm new to CGAL and in the fields of computer graphics. I'm currently interested in doing CGAL:Mean Curvature Skeletonization. I tested the simple example program and it works. As a result, it generated a 'skel.cgal' files, which i think is the points for the generated 1D skeletal.
The problem is i don't know how to display it because normally it will be '.off' file format. I think about converting it to '.off' but don't know where to start. Hope you guys can help me out.
The output is a set a polylines. The format is:
n1 x1 y1 z1 ... xn1 yn1 zn1
...
ni x1 y1 z1 ... xni yni zni
The first number is the number of points for a polyline, followed by the 3D points.
If you want to have a look at it you can try the CGAL Polyhedron 3D demo.
You can compile it yourself from sources or use the precompiled windows version with its required dlls.

Labelling text using Notepad++ or any other tool

I have several .dat, containing information about hotel reviews as below
/*
<Author> simmotours
<Content> review......goes here
<Date>Nov 18, 2008
<No. Reader>-1
<No. Helpful>-1
<Overall>4`enter code here`
<Value>4
<Rooms>3
<Location>4
<Cleanliness>4
<Check in / front desk>4
<Service>4
<Business service>-1
*/
I want to classify the review into two pos and neg , i.e. have two folder pos and neg containing several files with reviews above 3 classified as positive and below 3 classified as negative.
How can I quickly and efficiently automate this process?
You could write up a python script to read the overall score. Do this by looping over the the lines using readline() See here. Find the "Overall" Score using some string parsing. Then move the file into the right directory. All very simple things to do in Python, just break it down into steps and search for answers to those steps.
Notepad++ can do replacements with regular expressions. And allows the definition of macros. Use them to convert the file to an XML file. Check out the help file.
Then you can read it with any scripting language and do what you want.
Alternatively you could change the file to a form where you can load it into Excel and do the analysis there.

How to use Modern UI Icons in AppBarButton

I'm developing a Windows 8.1 Store App. I have a CommandBar control with a couple of AppBarButtons inside. Using the standard icons is easy, I just set the icon property to the appropriate string like so :
<AppBarButton Icon="Download" Label="Download Files"/>
I'd like to use a couple of custom icons from the very nice free collection Modern UI Icons. Ideally, I'd like to be able to set the icon property in much the same way :
<AppBarButton Icon="transit.distance.to" Label="Distance to destination"/>
This would refer to this icon : PNG / XAML
Is this possible ?
If not, what are the alternatives ?
Tim Heuer proposes using a font file, although at present the font files available here only cover a sub-set of the icons, and also this code is quite unreadable :
<FontIcon FontFamily="ms-appx:///modernuiicons.ttf#Modern-UI-Icons---Social" Margin="0,2,0,0" Glyph="" FontSize="37.333" />
Would you believe that shows a twitter icon?!
Tim Heuer also proposes using vector data, and one of the commenters explains how the vector data can be rolled into a style. I could do that, but then I would have to copy and paste the path data for each icon I want to include ?
Should I be using the PNG files, as explained in this question ? That looks pretty messy as well.
What a nightmare!
I'm not sure what the nightmare part is -- you want to use a custom icon that isn't present in the 200+ supplied defaults. You have options:
Use SymbolIcon and supply your own font. You note that you don't like that the code feels unreadable. Unicode ranges are universally used for symbol fonts and I agree that Unicode isn't human-readable, but a simple code comment would help ;-) Fonts give you the most ease and flexibility because they are also vectors.
PathIcon. You convert your image into vector geometries we can render. This would be the second best, but also requires a bit fine tuning of the vectors to get right. For people not familiar with working with geometries this can be annoying at first. Blend and Inkscape are helpful tools here.
BitmapIcon. This would allow you to use your PNG, however you now must supply multiple of them for different scales and states. This is my least favorite option as it requires most work, but for some may be the simplest. Now your problem you will hit is there is an issue with BitmapIcon for non-rectangular shapes (which looks like your icon is). This won't have the fidelity you seek due to a bug in rasterizing.
Contact metroicon author and see if he can put it into the font file so you can use option #1 :-)
Maybe this is what you're looking for:
<AppBarButton Label="Transit">
<AppBarButton.Icon>
<PathIcon Data="F1 M 3.912,17.38C 4.89067,17.38 5.688,18.2653 5.688,19.3586C 5.688,20.448 4.89067,21.3333 3.912,21.3333C 2.92667,21.3333 2.136,20.448 2.136,19.3586C 2.136,18.2653 2.92667,17.38 3.912,17.38 Z M 16,17.38C 16.984,17.38 17.776,18.2653 17.776,19.3586C 17.776,20.448 16.984,21.3333 16,21.3333C 15.016,21.3333 14.224,20.448 14.224,19.3586C 14.224,18.2653 15.016,17.38 16,17.38 Z M 21.3333,18.9626L 18.464,18.9626C 18.292,17.62 17.2547,16.5933 16,16.5933C 14.7453,16.5933 13.708,17.62 13.536,18.9626L 6.37467,18.9626C 6.20267,17.62 5.16667,16.5933 3.912,16.5933C 2.656,16.5933 1.62,17.62 1.448,18.9626L 0,18.9626L 0,10.2706C 0,9.396 0.636,8.69196 1.42133,8.69196L 19.5573,8.69196C 20.3387,8.69196 20.9787,9.396 20.9787,10.2706M 20.4427,10.2706L 19.1973,10.2706L 19.1973,15.8013L 20.62,15.8013M 17.776,13.432L 17.776,10.2706L 14.224,10.2706L 14.224,13.432M 13.5107,10.2706L 9.95333,10.2706L 9.95333,13.432L 13.5107,13.432M 9.24533,10.2706L 5.688,10.2706L 5.688,13.432L 9.24533,13.432M 4.97867,10.2706L 1.42133,10.2706L 1.42133,13.432L 4.97867,13.432M 14.5787,2.36932L 12.4427,0L 15.2867,0L 17.776,2.45862L 17.776,0L 19.1973,0L 19.1973,6.31732L 17.776,6.31732L 17.776,3.85864L 15.2867,6.31732L 12.4427,6.31732L 14.5787,3.948L 7.73467,3.948C 7.41733,5.31195 6.30267,6.31732 4.97867,6.31732C 3.40667,6.31732 2.136,4.90533 2.136,3.16132C 2.136,1.41064 3.40667,0 4.97867,0C 6.30267,0 7.41733,1.00531 7.73467,2.36932L 14.5787,2.36932 Z " HorizontalAlignment="Center" VerticalAlignment="Center"/>
</AppBarButton.Icon>
</AppBarButton>
Hope this helps!

What spatial SRID is this? (trying to convert a .shp file to WSG84)

I'm trying to import some Shapefile mapping data into Sql2008. Before I do that, I need to convert it to WGS84 / SRID 4326, because all my existing data is in this format.
This is the source file info:
GEOGCS["GCS_GDA_1994",DATUM["D_GDA_1994",
SPHEROID["GRS_1980",6378137,298.257222101]],
PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
I've tried googling for this and haven't had too much luck.
Secondly, I've tried to check the spatial_reference_systems table and I can't see it in there.
eg. SELECT * from sys.spatial_reference_systems
So, can anyone help me? I can't covert it to SRID 4326 if i don't know it's current SRID.
UPDATE 1
I found this page which explains the tech specs of GDA 1994 .. but doesn't hint at any SRID number... ???
UPDATE 2
This search result page also has some interesting results. From here, if you click on the SR-ORG:6643: Australia Albers Equal Area Conic link, it explains that datum .. and it's pretty much identical to the one I'm searching for. This means the SRID is 6643.
So is that the answer?
Using FME as my reference, this (GDA94) maps to EPSG:4283, which means that you need to use SRID 4283 (assuming that you're using EPSG-compliant SRID values)
Using this link GDA94 can be mapped to SRID = 4283 covering the Australian continent. If one knows, for example, that it is Western Australia it may be better to use SRID = 28350 and preserve greater accuracy.

Resources