I see you are from Sarajevo so you are probably need to convert GK coordinates from B&H coordinate system. First you will need to get transformation parameters for your area. I don't think there are any good one in EPSG database. Maybe you can use this one. I sometimes use them for area of Croatia.
Regarding the C# lib, there is one which I used Proj4Net.
Here is one my old example.
CoordinateSystemFactory cFac = new CoordinateSystemFactory();
Wgs84ConversionInfo par = new Wgs84ConversionInfo(514.0188, 155.448, 507.0461, 5.6136, 3.676, -11.4667, 2.091);
IEllipsoid ellipsoid = cFac.CreateEllipsoid("Bessel 1840", 6377397.155, 6356078.963, LinearUnit.Metre);
IHorizontalDatum Bessel1840 = cFac.CreateHorizontalDatum("Bessel 1840", DatumType.HD_Classic, ellipsoid, par);
IGeographicCoordinateSystem gcsBessel = cFac.CreateGeographicCoordinateSystem("Bessel 1840", AngularUnit.Degrees, Bessel1840, PrimeMeridian.Greenwich,
new AxisInfo("East", AxisOrientationEnum.East), new AxisInfo("North", AxisOrientationEnum.North));
System.Collections.Generic.List<ProjectionParameter> parameters6 = new System.Collections.Generic.List<ProjectionParameter>(5);
parameters6.Add(new ProjectionParameter("latitude_of_origin", 0));
parameters6.Add(new ProjectionParameter("central_meridian", 18));
parameters6.Add(new ProjectionParameter("scale_factor", 0.9999));
parameters6.Add(new ProjectionParameter("false_easting", 6500000));
parameters6.Add(new ProjectionParameter("false_northing", 0));
IProjection projection6 = cFac.CreateProjection("Transverse Mercator", "Transverse_Mercator", parameters6);
IProjectedCoordinateSystem zona6Bessel = cFac.CreateProjectedCoordinateSystem("6 zona Bessel", gcsBessel, projection6, LinearUnit.Metre, new AxisInfo("East", AxisOrientationEnum.East), new AxisInfo("North", AxisOrientationEnum.North));
IGeographicCoordinateSystem wgs84 = GeographicCoordinateSystem.WGS84;
CoordinateTransformationFactory ctFac = new CoordinateTransformationFactory();
ICoordinateTransformation zona6ToWGS84 = ctFac.CreateFromCoordinateSystems(zona6Bessel, wgs84);
toPoint = zona6ToWGS84.MathTransform.Transform(fromPoint);
I hope this helps a little. This code was written a long time ago but i think it works. You just have to insert your parameters.
The dataset you mention is a shapefile, a format invented by ESRI, but understood by most GIS software, including QGIS.
After extracting the zip, you can add it with Add vector layer
and point to the .shp file. The CRS information is stored in the .prj file, and the layer CRS will automatically set right by QGIS. In your case, NAD_1983_StatePlane_Louisiana_South_FIPS_1702_Feet
with US feet as units.
With the openlayers plugin
, you can add a Openstreetmap or Google background layer. For doing that, you have to set the project CRS to EPSG:3857
.
If you want coordinates in lat/lon degrees, just rightclick on the shapefile layer, and Save as ...
to a new file under a different name, selecting EPSG:4326
as CRS for that, and check to add that layer to the canvas. Saving may take some time.
For the next step, you better zoom in to see just a couple of points.
Open the attribute table, and click on the pencil symbol at the bottom to enter the edit mode, and then the field calculator icon bottom right. Create a new field named degx, type real
, precision 6
, and select $x
from geometry
. After saving (which takes some time), do the same for degy and $y
. Leave edit mode, then the attribute table.
The new columns in the attribute table give you lat and lon in degrees.
Best Answer
[EDIT] The original source data is California State Plane Zone 2, i.e. EPSG:2226.
The following approach using ogr2ogr will perform a CSV to Shapefile conversion, including the coordinate transformation to Lat/Long (i.e. WGS84) that you're desiring. Basically I'm just adapting the approach demonstrated in this post.
For GDAL/OGR < 2.1 you'll need to create a simple VRT tile to model the CSV content for OGR. (You can do this in notepad, just make sure to save the file extension as
.vrt
) This is the exact contents of thedispatch.vrt
file I created for this exercise.A couple notes..
I reused the name of the downloaded .csv file, without the .csv extension, as the layer name value.
I looked in the CSV for the
X Coordinate
andY Coordinate
field names, specifying those values, as OGR needs to know which fields represent X and Y to resolve the geometry.Next, I used the following ogr2ogr instruction to perform the conversion:
ogr2ogr -f "ESRI Shapefile" "C:/xGIS/Other/dispatch/sac-dispatch-4326.shp" "C:/xGIS/Other/dispatch/dispatch.vrt" -s_srs EPSG:32610 -t_srs EPSG:4326"
The -f "ESRI Shapefile" means I'm exporting to a shapefile, and the next value appearing in double-quotes is the shapefile I want to output.
The next file, the input, is the
.vrt
we create in the first step.Finally, -s_srs means, "the coordinate system of the source data" and the -s_srs means, "the coordinate system for the output data".
Ultimately the most difficult part of this exercise was identifying the correct projection of the source data. I used a process of elimination stemming from educated guesses. First I applied UTM10 as @Masjo suggested. But after plotting the resulting
.shp
it was obviously in a different source. The next best bet, I thought, was to go for the most appropriate CA State Plane, in this case Zone 2. And as you can see in the image here, the points appear about where I would expect to find Sacramento:For the fact-hunters out there, the source csv I downloaded from the OP's site had 329543 records in it, and ogr2ogr performed the conversion in just a few moments ..definitely less than a complete minute.