Hot answers tagged

7

Following on Ian Turton's comment... Prior to performing ANY geometry calculations or analysis on a layer(s), the layer(s) MUST be 1) projected to the desired CRS, and 2) that CRS must be the same for all layers. (Sidenote #1: in QGIS, projecting a layer to a different CRS is typically accomplished using Save As...) Your analysis will always fail if the ...


6

No, you need 14N (N is for Northern Hemisphere). The "Q" is just a latitude band designation. Latitude bands Latitude bands are not a part of UTM, but rather a part of the military grid reference system (MGRS). They are however sometimes used. Latitude bands Each zone is segmented into 20 latitude bands. Each latitude band is 8 degrees high,...


4

If you want to use a UTM-like projection that isn't a standard UTM zone, you can just specify your own Transverse Mercator coordinate system. Here's the PROJ.4 page on Transverse Mercator projections. If your grid origin is known in geographic Longitude, Latitude coordinates, your projection will look like: +proj=tmerc +lat_0=ORIGIN_LAT +lon_0=ORIGIN_LON +...


4

First import the data in the CSV it's actually in. Once the data is imported, then you can reproject it into the desired CRS. The coordinates in your CSV are in latitude and longitude. This means they're actually in a geographic coordinate system. The standard/most commonly used geographic CRS is EPSG:4326. Here's how your workflow should go (with the same ...


3

You can directly use shapely or GeoPandas but with 9888562 records It will take a long time to do (if you want a Progress bar during the pandas operations, you can use tqdm: ) 1) With your solution and the first 4 points import pandas as pd df = pd.DataFrame({'LAT':[47.9767,47.9803,47.9801,47.9798], 'LON':[-122.2450,-122.2458,-122.2472,-122.2465]}) ...


3

Short answer: No, UTM Zone 15 N is not the same as UTM Zone 15 T. Long answer: UTM Zone 15 N means the area bounded by: east-west boundaries are the longitudes 90° W to 96° W north-south boundaries are the equator and latitude 84° N UTM Zone 15 T means the area bounded by: east-west boundaries are the longitudes 90° W to 96° W (the same as UTM Zone 15 N)...


2

Those aren't UTM, they look like California Albers. You should confirm with your data source which datum it is, but for this example let's assume it's NAD83 California Albers aka EPSG:3310. To convert the points in Python you can use pyproj: import pyproj input = (-132880.64330000058, 206974.35539999977) # set up the source projection, EPSG:3310 CA ...


2

You can have many joins, so this should just work: SELECT utmid, count(points1.geom1) AS points1, count(points2.geom1) AS points2 FROM utm LEFT JOIN points1 ON ST_Contains(utm.geom, points1.geom1) LEFT JOIN points2 ON ST_Contains(utm.geom, points2.geom1) GROUP BY utmid; I highly recommend not naming fields in your tables after the table name....


2

The most likely answer here is that the UTM initialization is incorrect. Universal Transverse Mercator is a family of projections and by not specifying the correct zone the pyproj assumes central meridian at -183°: Proj('+proj=tmerc +lat_0=0 +lon_0=-183 +k=0.9996 +x_0=500000 +y_0=0 +datum=NAD83 +units=m +no_defs', preserve_units=True) Which is likely why ...


2

The fundamental problem is that the UTM zone is so far off the correct one that the projections don't behave as expected. The utm zone should be 31. It is odd that the central meridian is correct even in this case, but it is. Using the correct zone gives prompt> echo 3 0 | proj +proj=utm +zone=31 +ellips=wgs84 500000.00 0.00 prompt> echo 3 -.0001 |...


1

UPDATE: After thinking about it, the most efficient method for you to transform the coordinates is probably to not use apply but to use the column array. from pyproj import Proj pp = Proj(proj='utm',zone=10,ellps='WGS84', preserve_units=False) xx, yy = pp(My_data["LON"].values, My_data["LAT"].values) My_data["X"] = xx My_data["Y"] = yy Using Transformer ...


1

Looking at an open issue #543 on geopandas GitHub, it appears that what you want to do is not yet possible. As you have fiona then you can use: import fiona source_crs_wkt = fiona.open(shapedata).meta['crs_wkt'] print(source_crs_wkt) To give for example from an EPSG:4326 projected shapefile: GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298....


1

In the documentation for ogr2ogr: Usage: ogr2ogr(src_datasource_name, dst_datasource_name, layer, f, append, where: src_datasource_name: Character. Input vector file. dst_datasource_name: Character. Output vector file. these arguments are Character. Input vector file. - they are NOT spatial R objects. They would be, for example, paths to ...


1

Some countries have never published a countrywide projected coordinate reference system (CRS). The only way to discover it if no one contacts a GIS software vendor or CRS registry is if it's easily found on the national mapping agency's website or you start checking metadata information. According to the EPSG registry, there is one for Italy based on ...


1

Suppose you know that pixel (50, 75) is at (8.3, 2.3) degrees and pixel (250, 900) is at (12.3, 6.3) degrees. Then your pixel width W is (12.3-8.3)/(250-50) and your pixel height H is (6.3 - 2.3)/(900-75) Then your top left corner (centre of pixel (0,0)) is at (8.3 - 50*W, 2.3 - 75*H) - i.e. its 50 pixel widths left of the first reference pixel, and 75 ...


1

For your needs there are these CRS defined in the EPSG database: EPSG:5649 ETRS89 / UTM zone 31N (zE-N) +proj=tmerc +lat_0=0 +lon_0=3 +k=0.9996 +x_0=31500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs EPSG:4647 ETRS89 / UTM zone N32 +proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=32500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +...


1

As long as your data layers are already defined as WGS 1984, you should be fine with the following steps: Open data frame properties (right-click Layers in the table of contents). Select the coordinate system tab. Under projected coordinate systems, select UTM, then WGS 1984. I honestly can't remember if we had divided the zones into northern and southern ...


1

What you are looking for is grid convergence, grid north in UTM is not true north, the quick and dirty equation is: CA = (λ - λCM) × sin φ CA = Convergence angle λ = longitude λCM = longitude of Central Meridian of UTM zone φ = latitude (Kudos for V. Kelly Bellis) See How to calculate grid convergence (True North to Grid North)?


1

Kind of surprised that everyone recommended a software tool over what you wanted I need an algorithm. Can anyone point me to a reference to such an algorithm, or to open source software that does this conversion? Fairly well written is a lat/long to UTM conversion function written in Python - https://github.com/Turbo87/utm/blob/master/utm/conversion.py#...


Only top voted, non community-wiki answers of a minimum length are eligible