Using RPA shapefile to select Sentinel-2 data - shapefile

I have a shapefile which came from the Rural Payments Agency which is the complete set of fields for ourfarm. I would like to use this to find the bounding box for the download. The shapefile is encoded (according to the .prj file) using the British National Grid, GCS_OSGB_1936.
Having downloaded the relevant bit of the sensor data (I am interested in the Sentinel-2 visible and near infra-red so that I can do NDVI and EVI displays) I then want to clip the images to fit the fields.
I tried loading the sensor data and the shapefile, but I must have got the coordinate systems wrong because although I can zoom in on the farm on the sensor data, if I zoom in on the shapefile the sensor data is nowhere to be found.
Any pointers?

Try to change the CRS of the Vector file. Import in QGIS > Right Click > Set Layer CRS > Select the CRS. Hope This helps!

Related

Add error bars to a VTK 2D scatter plot

Is there a way to add error bars to scatter plot data using VTK? I am currently plotting point data using the C++ API; there is uncertainty associated with the data I am trying to plot which I would like to visualise also.
I can't find any obvious references in the documentation to error bars; the only mention I have found is in this Kitware presentation from 2011, which doesn't seem to be a function that exists.
Sample code snippet:
// Chart source data is populated etc...
vtkPlot* sampleScatter = chartXY->AddPlot(vtkChart::POINTS);
sampleScatter->SetInputData(chartDataTable, 0, 1);
// Here is where I would like to add the error bars -
// below method is from the link, and does not work
vtkPlotPoints::SafeDownCast(sampleScatter)->SetErrorArray(errorData.GetPointer());
// Chart is rendered...
where chartXY is a vtkChartXY object and chartDataTable is a vtkTable containing the x and y data in columns 0 and 1.
Is there a way to populate error data for visualisation in a similar fashion to the above, or will I have to roll my own chart type?
It turns out that this is not a capability that exists in VTK at the moment.
I have developed a basic capability to do this, which is currently the subject of a merge request in the VTK repository. Will update if/when this has been merged in and the capability is available.

Arrayfire - rendering a heatmap as an image/array with the available colormaps

I'm using Arrayfire to make a 2D heat transfer simulation. My dataset is a matrix of temperatures and I want to vizualize it as a heatmap. I need to produce frames of the colored dataset and save it as an image on the disk. So each temperature in my dataset has to be mapped to a color according to a certain color scheme.
I found that you can render the dataset in a window with a colormap using fig():
http://blog.accelereyes.com/blog/2013/07/03/arrayfire-examples-part-7-of-8-pde/
I also found that the colormaps available:
http://arrayfire.org/docs/defines_8h.htm#a553ceda8a1d8946efac3b08e642574ae
My plan so far has been to render the colored dataset using window.image() in a hidden window and then extract an array/image from the result so I can save this result using saveImage(). But I cannot find a way to extract the image rendered by the window.
Is there a better way to do this using the image processing functions? I would like to avoid defining my own color scheme. (i.e. making my own function that maps a temperature to a color)

How to read the data of Adience benchmark(data set for gender and age classification)?

I am trying to train a gender and age classification by cnn, using the data at adience and I got two questions.
1 : According to the website, the bounding box of the faces are recorded in the fields "x,y,dx,dy". As an example, from fold_frontal_0_data.txt,the first data is
image name : 10424815813_e94629b1ec_o.jpg
(x,y,dx,dy) : 301 105 640 641
However, the data of the bounding box is weird, because the size of the image is 600x601 only, no matter I treat (x,y,dx,dy) as (left, top, width, height) or (left, top, right, bottom), I cannot crop the face as expected. How could I crop the face properly?
2 : Do I need to do face alignment on training data? Or I only need to do face alignment when testing?Or both?Thanks
This is the image--10424815813_e94629b1ec_o.jpg
I am the other guy who dealing with Adience dataset.
File name of image you uploaded is
coarse_tilt_aligned_face.2.10424815813_e94629b1ec_o.jpg
not
image name : 10424815813_e94629b1ec_o.jpg
If you see README.txt precisely, you can find
original_image - the filename. Unfortunately we are unable to provide
a URL, as we only have the file name and there is no way to reproduce
it from the API. A link to the account is provided for accrediting.
(x,y,dx,dy) informations are should be gained from original_image.

How to set, for each raster band, the min and max color values (using GDAL)

I successfully created a multiband raster image using GDAL in MSVS (C++), but I do not know how to setup (for each band) the min and max color scale in order I could open the image in my QGIS application and the image loads with the proper color scale. I also would like to setup the contrast to extend from min to max.
Anybody have an idea how to code it?
Thanks in advance!
Compute the statistics for each raster band; see
CPLErr GDALRasterBand::ComputeStatistics for more info.

ESRI ArcGIS Client match map to WKID (Silverlight)

I am using the map service at http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer, which gives me a world map.
I have a shape file (.prj) that looks like this:
PROJCS["UTM:10N",GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["CLARKE 1866",6378206.4,294.9786982]],PRIMEM["GREENWICH",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["Central_Meridian",-123.0],PARAMETER["Latitude_Of_Origin",0.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],UNIT["METER",1.0]]
The locations relevant to the shape file are in western Canada (UTM:10N). Research seems to indicate that this is WKID 26710.
If I create the map layer and set the SpatialReference to 26710, no map shows. If I set SpatialReference to 102100, I get a map, but my points are in eastern France. This tells me that my reference is off.
I am processing the shape files, but I do not create or own them. How would you go about getting them to position themselves correctly in Canada? It seems that the answer would be to "get the right Spatial Reference", but all the searching I have done says that that is 26710.
The map service you're using only plots geometries supplied in the 102100 projection. If you have access to an ArcGIS Geometry server, you can convert your data points from the source projection to the one required by the map service. See http://resources.esri.com/help/9.3/arcgisserver/apis/rest/project.html
For example, if you have a point whose coordinates in the 26710 wkid are (491800, 5456280), you could do something like
http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/project?inSR=26710&outSR=102100&geometries=%7B%22geometryType%22%3A%22esriGeometryPoint%22%2C%22geometries%22%3A%5B%7B%22x%22%3A491800%2C%22y%22%3A5456280%7D%5D%7D&f=pjson
The x and y coodinates in that result should show up somewhere around Vancouver on the map service you linked.