projection

Changing the Projection of Shapefile

这一生的挚爱 提交于 2019-12-04 03:32:59
I am trying to change or assign the projection of a Germany-Shapefile from NA to +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 , but somehow it doesn't work well. Reproducible Example: Shapefile and other files can be downloaded here : What I tried is the following: library(maptools) library(sp) library(rgeos) library(rgdal) projection.x <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0") mapG <- readShapePoly("vg2500_lan.shp", verbose=TRUE, proj4string=projection.x) summary(mapG) mapG <- spTransform(mapG, CRS("+proj=longlat +ellps=WGS84 +datum=WGS84"))

Angular2: ng-content attributes passing to child component

心已入冬 提交于 2019-12-04 02:48:24
Is something like this possible? I want to pass an "hasfocus" variable from cjc-box through ng-content attributes to the cjc-input component. app.component.html <div cjc-box><div cjc-input></div></div> cic-box.component.html <div class="cjc-box"> <div><ng-content hasfocus="focus"></ng-content></div> </div> cic-input.component.html <input class="cjc-input" type="text" focus="{{hasfocus}}" /> Is this even possible with projections in ng2? It is possible to pass variable to projected content (assuming component cjc-box declares property focus and component cjc-input declares property hasfocus ):

Why features on WCS projected subplot are in the wrong place in matplotlib?

社会主义新天地 提交于 2019-12-04 02:20:08
问题 I have a fits file about an astronomical object. I can plot it like this: from astropy.io import fits from astropy.wcs import WCS hdul = fits.open(fitsfilename)[0] wcs = WCS(hdul.header) fig = plt.figure(figsize=(12,12)) fig.add_subplot(111, projection=wcs) plt.imshow(hdul.data) This works, and produces a nice pic: I would like to add some additional features to this plot, which doesn't work. For example lets try to add a circle to 119°, -67°30'. I expand the code by: plt.scatter([119],[-67.5

WebGL Isometric projection

隐身守侯 提交于 2019-12-03 22:14:23
问题 Alright- going nuts here. I'm doing some WebGL and I'm trying to make an isometric cube. I don't want to use Three.js. I want to first understand what is going wrong in my code. I've been researching and the only tutorials I can find seem to be for OpenGL At any rate- here's my drawScene function: function drawScene() { this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT); mat4.perspective(45, this.gl.viewportWidth / this.gl.viewportHeight, 0.1, 100.0, pMatrix); mvMatrix = mat4

Determining camera parameters

*爱你&永不变心* 提交于 2019-12-03 22:11:47
Given a picture taken by a simple digital that contains an image of a rectangle of known dimensions. How can I - to some degree of accuracy - determine the parameters of this camera? I am mostly interested in Pan-, Tilt- and Swing angles. Optionally distance to the rectangle would be nice. I acknowledge the fact that the focal length and resolution of the camera should be known, but it can be assumed that they are available (for example through exif metadata). Are there any simple algorithms for this problems? What you are looking for are camera calibration algorithms. A commonly used one is

Projection- Transforming 3d to 2d

放肆的年华 提交于 2019-12-03 17:24:34
问题 I have problem or well, I do not know how to transform 3d point with x,y,z values to 2d point, I have to draw projection, where I do have x,y,z values for points but I don't know how to transform them into 2d so I can move them onto my axis. I have been looking around wiki and google, howevever I'm not quite sure which matrix transformations should I use to get wanted result. 回答1: Let's first assume the camera looking at your scene is centered at the origin, and looking at the -z direction.

Plotting world map in orthographic projection is giving “non finite points”

ⅰ亾dé卋堺 提交于 2019-12-03 15:55:11
I have a shapefile of world countries, downloaded from here . I can plot it in R using countries <- readOGR("shp","TM_WORLD_BORDERS-0.3",encoding="UTF-8",stringsAsFactors=F) par(mar=c(0,0,0,0),bg=rgb(0.3,0.4,1)) plot(countries,col=rgb(1,0.8,0.4)) Now I wanna plot it in orthographic projection (Earth seen from outer space), so I'm trying countries <- spTransform(countries,CRS("+proj=ortho +lat_0=-10 +lon_0=-60")) I also played with the x_0 and y_0 parameters (as stated here ), but I always get the error: non finite transformation detected: [1] 45.08332 39.76804 Inf Inf Erro em .spTransform

opengl oblique projection

混江龙づ霸主 提交于 2019-12-03 15:07:32
I want to create a oblique (cavalier) projection in OpenGL. I know this operation is not default supported and instead I need a Shear Matrix and then make an Orthogonal Projection. Can you tell me what are the OpenGl steps / functions that I have to make? I've not used a oblique/cavalier projection before, but the following should give you an idea of how to proceed: Create a 4x4 shear matrix, H(θ, Φ) = | 1, 0, -cot(θ), 0 | | 0, 1, -cot(Φ), 0 | | 0, 0, 1, 0 | | 0, 0, 0, 1 | θ being the shear in X, Φ being the shear in Y, and Z being left alone. ( ref: slide 11 of http://www.cs.unm.edu/~angel

IQueryable Lambda Projection Syntax

跟風遠走 提交于 2019-12-03 14:54:09
I have an IQueryable whose Entity Framework 4 objects I would like to project to their DTO equivalents. One such object 'Person' is an EF4 class, and the corresponding POCO PersonP is a class I've defined. I am using Automapper to map between them. However, when I try the following code: IQueryable<Person> originalModel = _repo.QueryAll(); IQueryable<PersonP> projection = originalModel.Select(e => Mapper.Map<Person, PersonP>(e)); The projection generates this error at runtime: LINQ to Entities does not recognize the method 'TestSite.Models.PersonP Map[Person,PersonP](TestSite.DataLayer.Model

How to project a spherical map onto a sphere / cube: “Equirectangular to cubic”

天大地大妈咪最大 提交于 2019-12-03 14:46:43
UPDATE: I found that, http://os.ivrpa.org/panosalado/wiki , has an implementation in java. Anyone who has something similar in c or c++? I have this panorama, an spherical map from google streetview, and want to map this on a sphere/cube. Below are some examples and illustrations, what i seek is a library that can do it, or some implementation guides. I tried http://krpano.com/docu/tutorials/quickstart/#top that gives the results listed at the bottom. It illustrates what i want, but the rotation axis is off. I need to create the views of direct ahead and back, left and right. Ideal i would