Erroneous location when converting from a GCS_WGS_1984 to UTM


I have a shapefile map of Belgium divided by cantons that I want to re-project in order to have units in meters and to be able to calculate distances. I know how to do it with ArcGIS Projection tool, but the result always gets wrong map location.

I will detail my steps. First of all, my original map had unknown projection and coordinate system. However, it is pretty clear that it is in GCS_WGS_1984, with decimal degrees, since the Left/Top/Right/Bottom limits are precisely equal to the real ones of Belgium, when a map of this country is projected that way. So far, so good. I defined the GCS_WGS_1984 projection with DD units in ArcGIS, using the Define Projection tool.

The problem is in the next step. I then want to convert from that to another projection. One from which I can have units in meters. I tried a bunch of UTM options, using the Project tool after finding out that Belgium is around UTM 31N. However, no matter which UTM projection I choose, the location of the country after re-projected becomes wrong.

For instance, re-projecting from thw GCS_WGS_1984 to WGS_1984_UTM_Zone_31N gives me the following extent limits: Left:468861,233828 m; Top:5707355,258593 m; Right:742547,667605 m; Bottom:5485665,513781 m. That’s very off the target.

Could anyone point me what am I doing wrong or what is missing?

PS: Another detail is the following. I tried opening the original map among other country maps with the GCS_WGS_1984 projection in decimal degrees. All countries are positioned correctly. Then, I do the same operation described above to convert some countries besides Belgium to check what happens. All of them get located wrong – what means, my problem doest not seem to be in my Belgium files, but rather in me doing something wrong.

Convert shapefile to LonLat (R)


Just a small disclaimer: I don’t have any background in cartography, hence I might have missed the answer to my question in search just because I didn’t even know the keywords to look for.

So, I am using R to plot statistical data on maps. It was all fine and understandable when all of the materials came in same units of measurments (lon/lat in form of decimal degrees or degrees/minutes/seconds which have obvious and easy conversion).

So what I have encountered – doing routine fortify(shapeMap) to plot data with ggplot2 yields dataframe with values:

    long    lat order   hole    piece   group   id
1   563656.6    373826.0    1   FALSE   1   0.1 0
2   563864.6    373664.3    2   FALSE   1   0.1 0
3   564272.9    373895.4    3   FALSE   1   0.1 0
4   564491.6    373805.5    4   FALSE   1   0.1 0
5   565151.1    372709.0    5   FALSE   1   0.1 0
6   565328.3    372347.0    6   FALSE   1   0.1 0

...

As far as I understand that this is UTM coordinate system. And hence the question – is there an easy way to convert these coordinates to decimal degrees? I have dug through quite a few materials and online convertors but I can’t really seem to get the expected result.

Just for reference – shapefile coordinates above should be somewhere in Latvia. And Latvia is split among 3 UTM grid cells: 34V; 35V and 35U (if that is relevant at all).

Update: I have found out that coordinates are in LKS92 system. Hence now there is a clear objective. Convert LKS92 to WGS84. Guess now it is up to figuring out spTransform() function from rgdal package. Unfortunately it is not an obvious function with “from” and “to” arguments. Or at least at first glance.

Update2: Reference for those that will encounter the same problem:

  1. You have to be sure what coordinate system you want to conver from/into. In my case I found out it was LKS92.

  2. Find specific parameters for the coordinate system on spatialreference.org. In my case parameters look like “+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=-6000000 +ellps=GRS80 +units=m +no_defs”. Not that these are parameters for coordinate system FROM which I want to convert. If this is not WGS84 then you will want another parameter string for target coordinate system.

  3. R package proj4 has function project(). An example of LKS92 -> WGS84 conversion:

xy <- cbind(c(508148.442), c(319423.294))
project(xy, "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=-6000000 +ellps=GRS80 +units=m +no_defs", inverse = T)


[,1] [,2]
[1,] 24.1342 57.01823

Note the inverse=T which means convert to WGS84. Making inverse = F suggests that input coordinates are in WGS84 format.

Another small update:

To convert whole shapefile you would still need rgdal package:

proj4string(shapeMap) <- CRS("+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=-6000000 +ellps=GRS80 +units=m +no_defs")
shapeMap <- spTransform(shapeMap, CRS("+proj=longlat"))

First line defines the CRS of shapefile, second line tells what CRS to transform into.

convert points to same utm zone


I have lat/long and when I convert to UTM, my points are in zones 35 and 36.
is it possible to “transform” or “project” (I am not sure which word is used to do this operation) the UTM coordinates from zone 36 to zone 35 ?

Edit: Just to clarify
I have those two coordinates.

point 1: is in 35L 460880.04 E 8327740.29 S
point 2: is in 36L 201956.55 E 8375498.52 S

is there any way to say: point 2 is in 35L xxxxxxx E yyyyyy S ?

enter image description here

Combining UTM zones into one solid map


I have an area, example 4000m x 4000m. So, 4x4km. The origin can be placed anywhere, maybe in center, maybe on the top-left, nevermind.

Now, I want to fill this area with some stuff from OSM. I read a lot about UTM, zones, etc. UTM quadrant is divided into 6×10 100km squares, this squares are divided into 10×10 10x10km squares, this squares are divided to 10×10 1x1km squares and so on.

Getting back to my 4kmx4km square. How do I convert coordinates to place objects in my square and the position responds to reality?

To make it harder, let’s say that I want to put on the square objects from squares from different UTM quadrants from different zones, for example: most southern-east 1×1 from 34V, most southern-west from 35V, most northern-west from 35U and most northern-east from 35U.

Additional question: Is it possible to create one continuous maps (builded from smaller pieces), which covers the region composed of several UTM zones (for example, from 29W to 34S).

How to translate UTM coordinates properly?

EDIT
Ok, I implement Albers, Lambert and Equidistant projections for some tests. Input args: a = 6378206.4 m, e = 0.00676866, e2 = 0.0822719 Standard parallels: 55.0, 49.0 Origin: 52.205746, 22.514281

And results:

Albers : x = -489.71509; y = -2291.5

Lambert : x = -489.15250; y = -1653.5

Equidistant: x = -489.71533; y = -2289.5

I checked the algorithms and are ok, the results agree with the sample data. What is the reason that the result of the Lambert projection stands out from the rest? Does this mean that Lambert is better to applied to larger areas than the other two?

How to resample a DEM from GCS to UTM with respect to reprojection bounds parameter?


When reprojecting a DEM (e.g., SRTM-derived 1-arc DEM) using PCI Geomatica for example, to constrain pixel size and maintain a square pixel you can either change the image extent or the number of pixels, or both.
What are the implications of changing either parameters with respect to preserving the DEM accuracy?

PostGis: Geometry from UTM text


I have plain data in a postgresql table which looks like this:

╔════╦═══════╦═════════════╦══════════════╦══════════╦═════════════════╗
║ id ║ index ║   easting   ║   northing   ║ utm_zone ║ utm_zone_letter ║
╠════╬═══════╬═════════════╬══════════════╬══════════╬═════════════════╣
║  1 ║   1   ║ 233410.0000 ║ 1024701.0000 ║       38 ║ N               ║
║  1 ║   2   ║ 213310.0000 ║ 1167201.0000 ║       36 ║ N               ║
║  2 ║   1   ║ 213310.0000 ║ 1167201.0000 ║       31 ║ B               ║
║  2 ║   2   ║ 213310.0000 ║ 1167201.0000 ║       31 ║ B               ║
╚════╩═══════╩═════════════╩══════════════╩══════════╩═════════════════╝

Note: Coordinates are not real, but typed by hand

As you can see these are UTM coordinates but stored in plain db type fields.
I want to convert those last 4 columns to one of Geometry type for PostGis.
To something like this:

╔════╦══════════════════════╗
║ id ║       Geometry       ║
╠════╬══════════════════════╣
║  1 ║ 02347237427342342347 ║
║  2 ║ 27584872345646325863 ║
╚════╩══════════════════════╝

I used query similar to this:


--creates polygon with wrong SRID :( 
SELECT z.id, ST_Polygon(z.geom, 3395) geom FROM ( 
    --adds first point of line at the end to close it (requeird by ST_Polygon)
    SELECT l.id id, ST_AddPoint(g.geom, ST_StartPoint(g.geom)) geom FROM (
        -- groups points by ID and creates open line geometry from each group
        SELECT t.id id, ST_MakeLine(t.strPoints) geom FROM (
            --creates POINT(x,y) text from coordinates
            SELECT 
                g.id id, 
                g.index idx, 
                'POINT(' || g.easting || ' ' || g.northing || ')' strPoints
            FROM data g
            ORDER BY g.index
        ) t
        GROUP BY t.id
        HAVING count(t.strPoints) > 2
    ) g

) z
where ST_IsValid(z.geom)

But this does not use utm_zone and utm_zone_letter and points and lines are created without SRID value. Creating polygon from such values and specifing some SRID gives bad results. At same time because points and lines do not have SRID set I cannot use utmzone(geometry) DB function because it requires geometry to have SRID.

I looked at ST_Transform, ST_FromText and other functions but could not find one where I can specify UTM zone number and letter to create Geometry type value.
Creating point without specifying SRID gives me bad results – points fall on penguins in Antarctica which is wrong.

Can you tell me how to convert that data to correct Geometry values with correct SRID specified?

Which EPSG for UTM with 8 digits in QGIS


I have a UTM datasets with 8 digits, so the first digits are 32 (for UTM Zone 32N), but which EPSG should I use to get the data at the right spot in QGIS in a 6 digits system.

If I want to transfer UTM coordinates with 6 digits to 8, I think I could use EPSG 5652 (ETRS89 / UTM zone 32N (N-zE)) but which one I should use to get a 8 digit value to the 6 digits type?

How to work with UTM and multiple zones


I’m totally a newbie with geo tools. I’m using Sharpmap as I’m working with C#.

I have a map where I can put an item on a UTM Location with E,N Zone and number. So the item appears on the desired position.

The problem comes when I want to move the item to a new position. So, for example, I want to increase easting by 2000 meters.

How can I calculate if my item has crossed to a new zone? The easting ranges differ from equator to the poles, am I right? Is there a way to calculate easting ranges of a certain zone?

What is the best way to work with location points in different zones — for example, to calculate distance between them?

What UTM like coordinate system is this?


I have this set of coordinates: 4622580.00000, 503749.00000

They should roughly correlate with 51°01'39.4"N 13°44'44.2"E in Dresden, Germany.

At first I thought they might be UTM, but that puts me off the coast of Somalia. Does anybody have an idea? Or maybe they are UTM but with special options? I am unfortunately not very knowledgeable with coordinate systems.

enter image description here

How does the Buffer app append UTM parameters?


Buffer seems like a great way to link multiple social accounts and conveniently crosspost. There’s plenty of praise on the web for the service, it seems super user friendly, and it looks like it might be the right app for my use case.

But one thing I can’t readily find on the net: How does Buffer add UTM parameters?

A screenshot:

How does Buffer add UTM parameters

What UTM convention does Buffer use? And is there any way to customize this scheme for our particular purposes?

Question and Answer is proudly powered by WordPress.
Theme "The Fundamentals of Graphic Design" by Arjuna
Icons by FamFamFam