In QGIS, Layers CRS is EPSG 4326 and Basemap CRS by default comes EPSG 3857, When CRS is set to EPSG 4326 Basemap moves - geolocation

Layers CRS is EPSG 4326 and Basemap CRS by default comes EPSG 3857, When CRS is set to EPSG 4326 Basemap moves. Project CRS is set to EPSG 4326
As a result it does not load in Qfield app. Please let me know what is the solution.
I tried setting a new qgis file to epsg 4326 and add basemap still same result

Related

Gaps when using geopandas buffer closed polyline geometries

I am working on a problem where i need to search coastal areas using Sentinel-2 data. I want to use the OSM coastlines shapefile (https://osmdata.openstreetmap.de/data/coastlines.html) to select coastal areas of the raster using a 5km buffer.
Everything seems to work except i get gaps where i apply the buffer to smaller islands. I wonder if this is to do with the fact that the polyline is closed or too small an area. I do not have this issue with the main coastline.
The code i am using to make the buffer is this
import rasterio
import geopandas as gpd
from pyproj import Transformer
def get_osm_for_rstr(rstr, path_to_osm, target_crs=4326):
# get raster bounding box (in form (left, bottom, right, top))
bbox = rstr.bounds
# transform from raster crs to osm coastline crs (4326)
transformer = Transformer.from_crs(rstr.crs, target_crs)
x_min, y_min = transformer.transform(bbox.left, bbox.bottom)
x_max, y_max = transformer.transform(bbox.right, bbox.top)
# load osm data for raster bounding box
coast_wgs = gpd.read_file(path_to_osm, bbox=(y_min, x_max, y_max, x_min))
# Convert coast back to raster projection system
coast_utm = coast_wgs.to_crs(rstr.crs)
return coast_utm
rstr = rasterio.open(rstr_file)
coast_gdf = get_osm_for_rstr(rstr, path_to_osm)
coast_buffer = coast_gdf.buffer(1000)
The image below shows the issue i am having. The red lines show the osm coastline shapefile (they are in the form of LINESTRINGS). The light green shows a 1km buffer added. I have a gap in the buffer at the centre of the small island, which means i would lose this area if i crop the raster using the coastline buffer.
Does anyone have any suggestions why this is happenning? How i can include these interior areas in the coastline buffer? Thanks in advance for any advice.

Can the model coordinates and image coordinates be the same when using solvepnp?

Currently, I am trying to implement a camera pose tracking system. I have a set of model coordinate points(3D) of the previous frame and the image coordinates(2D) of the current frame.
I have also set an identity matrix(4x4) as the initial pose of the camera. For each new rvec and tvec calculated, I convert the rvec into a 3x3 Rotaton Matrix using rodrigues and then create a 4x4 homogenous transformation matrix and multiply it with the previous pose.
The rotation seems to be working properly, but the translation vector from the matrix seems to be moving only when rotated and not when translated, i.e it represents rotation.
Could it be that both my model coordinates and image coordinate systems are the same?
Edit: I am attempting to track the camera position using 3D-2D correspondences( Visual Odometry ) with a RGBD camera.
Update: Solved the issue. I seemed to be taking the wrong column of the Transformation matrix

How to assign a specific size to the marker in leaflet R

I am trying to plot spatial data using leaflet package in R. i want to change the location marker's default size. How can i assign a particular size to the marker in R leaflet package when i am using addAwesomeMarkers option

Highcharts -Highmaps making map curved(geojson QGIS)

I am trying to draw US outline in highmaps using geojson. My map is straight.
However I would like to make it curved like below link.
http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/maps/demo/us-counties/
Here is image of curved map.
Ignore below geojson as I can't paste all here.
Here is link to paste of geojson : https://paste.fedoraproject.org/413593/. Geojson was generated using QGIS. Below is map generated by this geojson
Here is quick link to test geojson.
http://jsfiddle.net/o7u6j6ck/
> > {"type": "FeatureCollection", "features":
> > [{"type":"Feature","geometry":{"type":"Mult
>
> iPolygon","coordinates":
It's a matter of projections. Geojson can only deal with WGS84, which is a subset of the Mercator Projection.
The curved map you've shown is drawn using the Albers-USA projection.
You can use D3.js to play with different map projections. IIRC D3 can read from valid GeoJSON/TopoJSON and reproject it using the projection of your choice.

How to crop polygon with latitude and longitude coordinates from geoTiff image in rails

I have GeoTiff image which contains latitude and longitude for each pixel instead of x,y coordinates.
My task is to crop this image on provided polygon by user. Currently I am trying GDAL for same, but didn't found perfect solution.
to crop or clip particular part from raster image use gdal libraries with either geojson or shape file. You need gdal-bin to clip/crop raster image. Use gdalwarp with -of parameter to specify output format(default GTiff-geotiff), pass your geojson path, your raster image path, path where you want to store output. Complete command looks like
gdalwarp -of GTiff -crop_to_cutline -cutline #.geojson #.tif #.tif

Resources