texts: Populate Elevation Data in GPX using FME

texts:
New to FME, and I have now spent more time than I would like to admit on this and need some pointers.
I have a GPX file that was made from a Shapefile. It has no elevation data.
I have the Terrain50 DEM as a GeoTIFF. I am using PointsOnRasterValueExtractor in FME to allocate the elevation data to the points before resaving the GPX. I have many thousands of these to do so I want to be able to batch process this.
I have checked that the two datasets are in the same projection, when I view the raster dataset in FME it has the data I need but I can't seem to populate the GPX Elev field. What am I doing wrong?


texts: How can I programatically set the "Description" for a ArcPy Geoprocessing Service?

texts:
When I create a Python Toolbox (pyt), I set the name and description of the toolbox. When I create the parameters, I can set their name, type, default value, in/out, etc. Basically, everything that the system needs to know about this toolbox is contained in the Python code and object attributes.

Now I want to publish this pyt as a geoprocessing service. I go through the steps and click Analyze and it says that all of my parameters are missing descriptions and it won't let me publish until they're filled in. If I'm debugging or experimenting, this results in a lot of parameters with a description of 'asdf'.

It seems like there should be somewhere where the Description for the properties could be filling in or specified, but I've yet to find it. Any ideas?

EDIT:
Even in Catalog, I can't set the Description on the individual parameters until I go to publish them. I have a few geoprocessing services, each with multiple parameters, all in one toolbox. Having to set the parameter descriptions on each parameter, even if just to a dummy string like 'asdf' is a PITA.


texts: Is it possible to prevent ogr2ogr from generating a shapefile if no records are returned from the given intersection?

texts:
I am generating shapefiles from a geodatabase file with ogr2ogr via the spatialite dialect using the following command:
ogr2ogr -f "ESRI Shapefile" ./clipped.shp -dialect sqlite -sql "SELECT * FROM table_name WHERE ST_Intersects(SHAPE, GeomFromText('POLYGON ((46.93 -17.48, 46.91 -17.55, 47.01 -17.56, 47.01 -17.46, 46.93 -17.48))'))" ./geodatabase_file.gdb

The command itself works exactly as expected - returning only the records that are intersected by the given spatial query.
There are however, times when no records are returned by the intersection. When this happens empty shapefiles are generated that contain no entries. Is there a way to prevent ogr2ogr from generating files if no records are returned from a provided intersection?


texts: Republishing AGS Service Doesn't Update Web Map in AGOL

texts:
I created a web map in my AGOL content folder after publishing from ArcMap as a Portal feature service. I created a web map in AGOL by bringing in the service URL. I have three group layers with several layers within each group. In the AGOL map viewer, I went through each layer and configured the popups and symbology. After I had done this, I needed to add a new layer to one of the groups, so I added it to my MXD group layer of interest, republished the service and then went to the web map that is fed from this service.

The web map doesn't update with the new layer, so I was trying to figure out how to update the web map without having to recreate the entire thing in AGOL. I don't want to really do this each time I have to add a new layer in the MXD because of the configurations I have on each layer with the popups and symbology.

Am I missing some process/option to refresh the TOC so that it adds the changes I made to the service?

In ArcMap my TOC looks like this with the new layer highlighted:

But after republishing, the TOC in AGOL map viewer only shows 3 of the 4 layers:

I have the Refresh Interval activated to 6 seconds. I've tried publishing several times as a map service, signing in/out of AGOL, etc.


texts: Merge 2 Pointlayers with same coordinates but different attributes in QGIS?

texts:
I have two layers with points who have exactly the same coordinates but different attribute fields. I would like to merge the tow layers so that I only have one point at each location who has the attributes from both layers.
I have the feeling that this should be very easy but I just cannot do it and cannot find any expalanation.


texts: Select features by matching attributes of two shapefiles?

texts:
I have one line shapefile with lot of road sections and a point shapefile, some of these points are outside my area of interest.

The files have one attribute in common and I would like to do selection, where I select only those points that have matching attribute value with the line shapefile.

Is this possible in some meaningful way?

I believe that in this particular case I could do line buffers and use those to select the point in buffer area - but I was wondering if its possible to match the values "straight away" with each other.


texts:
Looked around but couldn't find the answer to my question, so here goes. I am trying to export some decent quality (300dpi) aerial images from QGIS using the OpenLayers plugin. Sometimes it works, and then sometimes it doesn't. The export goes through just fine, but when I go to the file it looks like this.

Basically I get the image I wanted in the center, but it's hacked off at the sides and corners into a rough oval shape, with a zoomed-in image filling the gaps around it.

It's weird.

This happens whether I export as jpg or pdf, whether I check print as raster or not. I reset the project projection to the google aerial's projection; that didn't help. Previously I thought I was causing this problem by trying to export too large or with the resolution set too high, but now it's happening all the time.

Any ideas why this is happening and how to get around it?


texts: Removing redundant points contained in pixel using QGIS?

texts:
When rendering a tile, many points in a csv file are located in the same pixel, which are not necessary since they all overlap each other in this pixel.

Can I remove these redundant points only rendering a point in this pixel?


texts:
Using the US Census Tract API I can search for the age population in different parts of the country

http://api.census.gov/data/2010/sf1?key=[key]&get=PCT0120125&for=county:*

returns list of women aged 18 by county and PCT0120021 for men.

[
["PCT0120125","state","county"],
["405","01","001"],
["1153","01","003"],
["163","01","005"],
["137","01","007"],
["361","01","009"],
["56","01","011"],
["137","01","013"],
...

How could I look up the corresponding information by Census tract?
Something like for=tract:* but that gives me error messages error: unknown/unsupported geography heirarchy.


texts: How to combine/merge *.lul files to shape format?

texts:
I got multiple files, say 2500, I never heard about lul files before. anyway I visualised it in QGIS after number of attempt in Autocad map 3d and ArcGIS. it is basically like Basemap:Road, parcels, and with labels of Road name, Plot No. etc.

Now I am trying convert it to one shapefile (lines, poly) and text would definitely be the POINTs with label as attribute in it.

Update: Here is snapshot for sample file.


texts: pgRouting: calculate many-to-one shortest paths

texts:
In a previous question on how to calculate many shortest paths, @dkastl pointed to the pgr_kdijkstra function, which allows to calculate each time the total cost of one source-to-many targets shortest paths, by giving an array of target nodes.

What I'd like to do is, to calculate the total cost of many sources-to-one target shortest paths. A solution could be to switch source and target, but then I'm actually calculating the total cost of a different chain of paths, given the fact I'm using a directed topology network.

@UnderDark already provided a solution for this problem, but, out of curiosity, my question is:

Is there a way of modifying the pgr_kdijkstra function such that you're able to give an 'array of sources' and 'one target' as input?

Something like (given the example of pgRouting manual):

SELECT seq, id1 AS source, id2 AS target, cost FROM pgr_kdijkstraCost(
'SELECT id, source, target, cost FROM edge_table WHERE cost >= 0',
array[4,12], 10, false, false);

 seq | source | target | cost
-----+--------+--------+------
   0 |      4 |     10 |    4
   1 |     12 |     10 |    2

Thanks!


texts: Automatically georeference non-intersecting UAS photos based on contained EXIF metadata

texts:
I need to know how to automatically create georeferenced rasters from multiple non-intersecting photos taken by UAS DJI Phantom 4 Pro.
All EXIF metadata is present in every photo - coordinates, height, camera angles (yaw, pitch, roll). Here is screenshot, with EXIF metadata.

I uploaded some photos, which I need to georeference: Photo 1, Photo 2, Photo 3.

Theses photos do not intersect, so it is impossible to create orthopoto with automated photogrammetry software (e.g. Agisoft Photoscan, Pix4D Mapper, Trimble INPHO). Of course, I can georeference these photos manually in desktop GIS based on underlying satellite imagery, but it is not feasible due to large number of images and time constraints.

We regularly perform monitoring flights over rivers and open water areas and take number of non-intersecting images when we observe species of interest. We need to quickly georeference these images for subsequent use as a layer in GIS for further analysis.

I realize, that this is not standard UAS scenario, but I hope there will be solution. We do not need precise georefencing, just a tough one will suffice.

I have seen something similar done with MISB-compliant video for UAS by means "Full-Motion Video" Plugin for ArcGIS.  MISB-compliant video has coordinates and camera orientation parameters which Full-Motion Video Plugin utilizes for georeferencing any single video frames: Full Motion Video (FMV) ArcMap (by Esri).

So, I am looking for something similar for UAS photos.


texts: No placement inside feature dataset using arcpy XYtoLine?

texts:
When I run the following code with the outFC creation path set to a feature dataset inside a file geodatabase...

arcpy.XYToLine_management(tempFC, outFC, "POINT_X", "POINT_Y", "NEAR_X", "NEAR_Y",
"GEODESIC", "", formatSpatialRef)

...I get the following message:

ERROR 000582: Error occurred during execution.

The script runs without errors when I set the outFC creation path to the root level of the gdb. Spatial references for the feature dataset and the output FC are identical. I'm wondering if this is a case of a built-in behavior similar to what is described in this posting:

http://forums.arcgis.com/threads/39448-Using-Python-can-t-get-Batch-Project-outputs-to-save-in-a-feature-dataset


texts: Creating a Construction Tools Rectangle Template

texts: I am working on a project that requires me to place hundreds of 20x20 ft squares as polygons in a feature class. Right now I am manually making them by entering height and width values. I am wondering if there's a way to create a template for a 20x20 ft square that I can place wherever I like. It would great if I could store this template in the construction tools window.


texts: Estimating Water Area for Several Regions in GEE

texts:
I have been trying to estimate the water area for several regions using the JRC/GSW1_2/MonthlyHistory. Here is a sample of the code:
//Opening the JRC Water Data
var water_data = ee.ImageCollection("JRC/GSW1_2/MonthlyHistory")
var filtered = water_data.filter(
  ee.Filter.date('2018-01-01', '2018-01-31'))
var water_area = ee.Image(filtered.first())

//Creating Region Variable
var turkeyProvinces = ee.FeatureCollection("FAO/GAUL_SIMPLIFIED_500m/2015/level1")
    .filter(ee.Filter.eq("ADM0_NAME", "Turkey"));

//Calculating Water Areas
var calculateClassArea = function(feature) {
    var areas = ee.Image.pixelArea().addBands(water_area)
    .reduceRegion({
      reducer: ee.Reducer.sum().group({
      groupField: 1,
      groupName: 'class',
    }),
    geometry: feature.geometry(),
    scale: 30,
    maxPixels: 1e10
    })
return areas
}
var districtAreas = turkeyProvinces.map(calculateClassArea);

The problem is that the code estimates the area of the regions instead of the Water areas within the regions. Link to the code.


texts: How to select a raster file that is under a polygon in a vector file?

texts:
I am using:
v.db.select map=PHL_adm1 where=NAME_1='Bulacan'

My vector map is over the raster map. I want to select the part of the raster map under the polygon(NAME_1='Bulacan') of a vector. Is it possible to do?


texts: Changing CSV layer attribute value from text to number in QGIS?

texts:
I read in a CSV file for linking to a .shp file.

All the variables that are just numbers came in as text.

How do I change the text variables to numeric in QGIS?


texts: How to save results of OGRSpatialReference::AutoIdentifyEPSG()

texts:
Not that I see the need to programmatically mass-convert shapefiles, but there must be a way to store the EPSG authority in a converted and auto-identified shapefile.

My little C++ program can use the GDAL API to ...

read a ETRS89_UTM32 shapefile dataset via GDALOpenEx(),
check that it isn't EPSG:32632 by calling GetLayer(0)->GetSpatialRef()->GetAuthorityName() and GetAuthorityCode(),
convert the file to EPSG:32632 by calling GDALVectorTranslate(),
GDALOpenEx() the resulting shapefile,
realize that its SRS still doesn't contain an EPSG authority entry (why not, BTW?),
AutoIdentifyEPSG() the SRS, and
check that the EPSG code now is indeed 32632

-- and then what? If I call GDALClose() on my freshly converted shapefile dataset and re-open it, its SRS still shows up as WGS_1984_UTM_Zone_32N, without any AUTHORITY entries.

This might have something to do with this comment in OGRLayer::GetSpatialRef():

  The returned object is owned by the OGRLayer and should not be modified or freed by the application.

So: just converting a shapefile to EPSG:32632 (either in the console via ogr2ogr or programmatically via GDALVectorTranslate()) doesn't set any EPSG entries in the SRS. Performing AutoIdentifyEPSG() on the SRS does set the correct authority, but I can't seem to save it to make it stick.

What am I doing wrong?


texts: How to calculate cumulative decreasing sum in ArcGIS-10.2

texts:
I need to calculate the cumulative decreasing sum as a field in a rasters attribute table. The cumulative decreasing sum is the accumulation of the last values to the first, so it is basically the ordinary cumulative (or cumulative increasing) sum in reverse order. I recently asked a similar question; how to calculate the ordinary cumulative sum, which was answered by pasting the following in the pre-logic script box of the field calculator,

total = 0
def cumsum(inc):
 global total
 total+=inc
 return total

before running the "cumsum" operation on the source field.

This works well. I would prefer if someone could adapt this script to calculate the cumulative decreasing sum instead, but I'm open to any suggestions.

Please note that I have very limited scripting tools, so if the solution you provide is not simply an adaptation of the above script, please detail your solution in a step by step manner.


texts:
I have noticed that Google Maps API provide the ISO code as the short name for the country. However for regions it is quite variable...
For instance if I want to check Madrid, Spain:

ISO-Code Spain: ES
ISO-Code Region of Madrid: MD (Google does not provide this one)
ISO-Code City of Madrid: M

And this is just an example. For Germany it does not return the ISO Codes for the cities.

How can we parse the location with our private database? Does the Google Maps API follow any standard for the codes?


texts: How to convert NetCDF file to Grib2 or Grib files

texts:
I'm in trouble to read NetCDF file data. Basically NetCDF file contains Ocean current data.
How do you convert a NetCDF file to a Grib2 or Grib file? I already have procedure to read data from Grib2 file using OpenGrads version 2.0.
What I need overall is to generate image for ocean current components available in netCDF and display on map.

Can anyone direct/correct me how to accomplish this task.


texts: Date field not showing in Esri Feature services?

texts:
I published a feature service with one field as a date.

When I consumed the web service and I open it up in a web map, in the configure attributes, the date field is not showing up.

I have handled it before but cannot recollect how. Perhaps it's done at the geodatabase level?


texts: When joining a CSV file to a Vector layer on QGIS, the Graduate style can't be classified

texts:
I have a CSV file with GEOID, GEO.id2, and then 5 calculated values. I am trying to make a map using the graduated style with my shapefile.

I have made a CSVT file w/ "String","String","Real","Real","Real","Real","Real"
Also, I have tried adding the CSV by Layer/AddLayer/AddDelimtedTextLayer with selecting "No Geometry"

However, after I join the CSV to the shapefile, and go to Style/Graduate and classify, all the values come up as 0. It happens for each of the 5 values I have on my CSV file.


texts: Subset raster stack in R by a vector of number sequences?

texts:
I have a large raster stack that I need to subset by somewhat irregular time spans. I'd like to do something like this:

rstack[[c(1:3, 4:8, 9:15)]]

But there are 30 sequences like the ones above that I need to subset by, and I'd rather not type them all in manually.

I'm wondering if I can create a vector object, something like this:

vec <- c(1:3, 4:8, 9:15)
rstack[[vec]]

But based off of a data frame where I have the start, end values for the sequences to automate the process?:

df <- tibble(
start = c(1, 4, 9),
end = c(3, 8, 15)
)

# A tibble: 3 x 2
  start   end
  <dbl> <dbl>
1     1     3
2     4     8
3     9    15


texts:
For example, our subject of interest are coffeeshops, and user wants to lookup all coffeeshops located in Mitte district of Berlin.
In order to do that he selects Berlin as city, Mitte as district and submits form.

Than he should see map that is zoomed  and centered on the given district, like https://nimbus.everhelper.me/client/notes/share/323673/Iiw6bfSPRoJTTTLSUte0RPhmRv28y4CQ/

As the last step  application needs to get the borders of the displayed area and query server for all available coffeeshops inside it.

I'm not familiar with the Google Maps API very much and have only a general plan how to do that:

find POI polygon
initialize map centered and zoomed on the POI polygon
get the displayed area bounds
do the other work

the first two steps seems to be black box for me now. Can anyone familiar with google maps API please help break this down into the consecutive steps that I can just implement with JavaScript?


texts: ArcGIS server on Amazon EC2 vs buying your own machine. Pro's and Con's

texts: What are the pros and cons using this virtual machine compared to buying your own?


texts:
I'm tasked with recreating a report previously made by a different company, with updated datapoints. Clearly I'm not in the possesion of the previously used GIS files, so I'm doing my best to recreate the looks of the old images.

Original image:

My reproduction:

As you can see the original has a clear black outline, even on the smallest version of the symbol, whilst mine only have it on the larger versions.

I tried to increase the width of the outline by making my own symbol, where two circles overlap each other, a larger black one, and a smaller green/blueish one. As in this screenshot:  Obviously without succes.

Is there a better way to recreate the original image?
Using ArcMap 10.6


texts: FloatingPointError: invalid value encountered in greater_equal in Semi-Automatic Classification Plugin in QGIS

texts:
2019-04-05T00:29:33 WARNING Traceback (most recent call last):
File
"C:/Users/ASUS/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\dock\scpdock.py", line 2503, in saveROItoShapefile
cfg.utls.calculateSignature(cfg.shpLay, cfg.bandSetsList[cfg.bndSetNumber][8], [self.ROILastID], cfg.ROIMacroID, cfg.ROIMacroClassInfo, cfg.ROIID, cfg.ROIInfo, 50, 40, "No", "No", UID)
File "C:/Users/ASUS/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\core\utils.py", line 1739, in calculateSignature
ROIsize = cfg.utls.getROISize(bX, 1, rStat[0], rStat1)
File "C:/Users/ASUS/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\core\utils.py", line 5672, in getROISize
s = ( (a >= min) & (a FloatingPointError: invalid value encountered in greater_equal

The error appears when saving ROI as training cells.


texts: Project raster with geographic transformation works stand alone but not in model with iteration

texts:
I will briefly describe my unsuccessful model shown below. It fails at the very last Project Raster step, where I receive an error mesage.

The model: I have a workspace called South America. It contains a folder for every country in South America (I have the same model for each continent...it works when there is no geographic transformation involved in the projection). Each of the country folders (which I iterate over) has a folder called GL30tiles. This folder contains several rasters. I use the Workspace to Raster tool to merge the rasters into a file called GL30mosaic.tif. I then project the mosaiced raster to the South America Albers Equal Area Conic projection.

The GL30Mosaic.tif is in a UTM_WGS_1984 projection. The built-in ArcMap South America Albers Equal Area Conic Projection is in the South American Datum 1969 (SAD_1969). There is a geographic transformation involved in projecting GL30Mosaic.tif(2) to GL30Mosaic_Project.tif.

When I try running the model, I receive the following error message when it gets to the Project Raster step:

The Project Raster dialogue box when I run the model looks like this:

If I simply take the GL30Mosaic.tif and project it in South America Albers Equal Area Conic as a stand-alone operation in ArcMap, there is no problem. When I specify the input raster, the input coordinate system automatically updates. I then specify the Output Coordinate System. When I do that, the Geographic Transformation box automatically updates to SAD_1969_To_WGS_1984_14.

It would seem that the automatic coordinate system updating and geographic transformation selection that occurs when I run the project raster as stand-alone does not occur when running in modelbuilder.

I tried passing GL30Mosaic.tif(2) into the Create Spatial Reference tool, and passing the output into the Project Raster tool, making it the input coordinate system and a pre-condition, but then I receive: Error 999999: Error Executing Function, Failed to Execute Create Spatial Reference.

I could do the raster projections in question one-by-one, but it's going to be long and painful. I would like for it to work in Modelbuilder so that I can press run, go to sleep, and come back in 10 hours, but have been unsuccessful in troubleshooting this error.

There was a similar question on the StackExchange here but that question did not involve a geographic transformation. Indeed, when there is no geographic transformation involved, my model runs perfectly. For example, in Africa the output projected coordinate system is Africa Albers Equal Area Conic, which is in WGS 1984, the same as the GL30Mosaic.tif. No problems.

So the crux of the issue here seems to be that Modelbuilder is failing on the Geographic Transformation issue that does not appear when projecting the rasters one-by-one. How to overcome this?

EDIT: I am including the revised model which passes the geographic transformation as a string into the project raster tool. It doesn't completely solve my problem (see my comment in the comment section), but at least the model runs and creates output.


texts: Converting data in table created by Zonal Statistics as Table tool back into raster file?

texts:
In arcGIS 10 I have worked on a number of raster files, from which I have created one large table by using the Zonal statistics as Table Tool. I have a result as shown below (I have more than 70,000 rows, thus only showing the first 9 here):

OID LO  MAG PCR WAT SVE ARA GRA FOR MHF     B13 B12 MTP BI6 BI4     ALT
1   1   0   0   0   0   0   0   0   32.00   100 420 43  72  4821    18.18
2   1   0   1   0   0   0   0   0   39.17   99  421 81  72  4886    20.14
3   1   0   0   0   0   1   0   0   29.25   112 474 13  74  4947    132.80
4   1   0   0   0   0   0   1   0   35.98   114 485 4   70  4997    166.54
5   1   0   0   0   0   0   0   0   39.21   104 438 3   74  4859    54.82
6   1   0   0   0   0   0   1   0   40.45   109 454 3   68  4971    107.65
7   1   0   0   0   0   0   1   0   41.81   107 435 2   69  4909    46.70
8   1   0   0   0   0   1   0   0   49.78   105 427 21  70  5009    18.36
9   1   1   0   0   0   0   0   0   53.00   106 427 98  70  5173    13.33

I have created this table because I needed to do a regression analysis, explaining the presence/absence of LO by my explanatory variables (all but OID and LO).
Now, I need to export each of my variables (LO, MAG, PCR...) as ASCII files, all with the same extent and cell count, in order to analyse them further in a different program. This means I need raster files again, to convert raster to ASCII.
But as my original raster datasets are different in both extent and resolution, I figured it would probably be easiest to convert my table into different raster datasets. In that way, all my datasets would contain the same number of cells. I have however tried myself, and searched online, finding no clues as of how to do this.

Does anyone know if it is possible to create raster files from a table?

I have already tried to give each of my individual raster dataset the same extent and cell size, with no luck. I have tried clipping my raster (using both Maintain clipping extent and Use input feature for clipping geometry), but it still creates raster with different number of rows and columns.

I am unable to give my raster files the same extent.


texts: What are differences between ArcGIS Web APIs (JavaScript/WPF/Silverlight/Flex)?

texts:
Esri currently offers 3 different web API's that can be freely downloaded.

Are they all equal?

If not, what are the relative strengths/weaknesses of each of these API's?


texts:
The ValueError: Invalid field type  is caused at the last line of this code: fs.to_file(out,encoding='iso8859_7')

Full code:

q=gpd.read_file(fname + "\ASTENOT\simplify_centerline.shp",encoding='utf-8')
q.reset_index(inplace=True)
final = pd.merge(df, q, on=['FID_buffer'], how='inner')

#Turn it to geodataframe so it can be exported to shp
fs=gpd.GeoDataFrame(final, geometry='geometry')

o = fname + "\ASTENOT"
out = o + '\\simplify2.shp'
fs.to_file(out,encoding='iso8859_7')

After printing the data frame, one of the columns has be turned to this  b'\xc5\ kind of characters. Apparently this is causing the error but I don't know how to fix it. Probably encoding issue? Tried many ways but no results.
How can this be corrected?


texts:
I am trying to add london shapefile for buildings in my android app. However, I am unable to display it. Its showing nothing on the map. But the same shapefile is getting displayed properly online. So, there is nothing wrong with the shapefile.

I downloaded shapefile from
https://docs.google.com/uc?id=0B0kRhiw4fD7uQzU3MzBMRzFfSFk&export=download

My code:
layout.xml

<!-- MapView layout and initial basemap and extent. -->

<com.esri.android.map.MapView
    android:id="@+id/map"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    mapoptions.ZoomLevel="5"
    mapoptions.center="18.0000, 79.5800" >
</com.esri.android.map.MapView>

MapActivity.java

    mMapView = (MapView) findViewById(R.id.map);
    mMapView.enableWrapAround(true);
    String mShapefilePath = "/london_buildings/TQTL_LON.shp";

    String mSdcard = Environment.getExternalStorageDirectory().getPath();

    mMapView = (MapView) findViewById(R.id.map);
    ArcGISTiledMapServiceLayer mTiledlayer = new ArcGISTiledMapServiceLayer(
            "http://services.arcgisonline.com/arcgis/rest/services/ESRI_Imagery_World_2D/MapServer");

    mMapView.addLayer(mTiledlayer);

    try {
        shpFileFeatTable = new ShapefileFeatureTable(mSdcard + mShapefilePath);
        mFlayer = new FeatureLayer(shpFileFeatTable);
        mFlayer.setRenderer(new SimpleRenderer(new SimpleMarkerSymbol(Color.CYAN, 2, STYLE.SQUARE)));

        mMapView.addLayer(mFlayer);
    } catch (FileNotFoundException e) {
        Toast.makeText(getApplicationContext(), "File not found in SDCard, nothing to load", Toast.LENGTH_LONG)
                .show();
    } catch (RuntimeException e) {
        Log.d("**ShapefileTest**", "File not found in SDCard, nothing to load");
        Toast.makeText(getApplicationContext(), "File not found in SDCard, nothing to load", Toast.LENGTH_LONG)
                .show();
    }


texts: Update shapefile data source with wildcard using python

texts:
I am attempting to update a layer's data source in Arcmap using python

for lyr in arcpy.mapping.ListLayers(mxd, "*", df):
    if lyr.name == "project_whl":
        lyr.replaceDataSource("F:\\Jobs2012\\05665\\EPASS\\", "SHAPEFILE_WORKSPACE","1205992_whl")

This WORKS!

HOWEVER I would like to use a wildcard instead of explicitly stating the dataset_name

Example below:

for lyr in arcpy.mapping.ListLayers(mxd, "*", df):
        if lyr.name == "project_whl":
            lyr.replaceDataSource("F:\\Jobs2012\\05665\\EPASS\\", "SHAPEFILE_WORKSPACE","*whl")

Yet does not work, I have tried *, ?, %, _, & none of these work...

Just get the following error message

<type 'exceptions.ValueError'>: Layer: Unexpected error

Your thoughts, ideas?


texts: Making flood map greyscale in ArcGIS for Desktop?

texts:
I have produced an article for publication and I have just been informed that I must produce all maps in colour and greyscale as the printed journal is only published in greyscale but the article will be made available in full colour for download. I'm looking for advice/guidance on making the below maps suitable for printing in greyscale but still easily understood.

How should I display the different layers (the vulnerability ranking, the centroids, the flood zone etc.) so that the entire map remains easily identifiable and understood when printed in greyscale?


texts: Model for spatial distribution of resources in PostGIS?

texts:
I'm looking into a way to calculate the performance of each shop (funeral directors) based on resources available (funerals in last 5 years).
Please see image attached, numbers are total funerals into each zone and points are existing funeral directors.
Basically trying to allocate each resource into each funeral based on location (mostly proximity) and not counting twice a resource.

I'm working with PostgreSQL/PostGIS (v10-11) and can work with QGIS and ArcGIS.

Open to previous experiences and suggestions.


texts: Performing Regression Analysis using ArcGIS for Desktop?

texts:
I am trying to perform regression analysis using road accident data using ArcMap 10.1. The accident data is a point file for all accidents with information on the date the accident happened, time, male or female, weather conditions, vehicle manoeuvre etc, very detailed.

I also have a polygon data set of census tracts. My issue is that I can join the two but only get a column containing the total number of incidents (accidents) per census tract.

How can I perform regression analysis using data at 2 different scales?

The independent variables I am interested in are contained in the point data set.


texts: OSM data appear in very low quality in QGIS

texts:
This is my first map creation attempt in QGIS 2.8.2. I am having trouble in making it look good though with OpenStreetMap (OSM) street map data in particular.
I import data via Web>OpenLayers Plugin>OpenStreetMap.

I don't understand why the quality is so low, when it should be looking like that:

http://www.openstreetmap.org/#map=13/52.9474/-1.1467

Might be something I have missed but I can't seem to find anything similar online. Any tips?


texts: Add Join of data table to shapefile in ArcGIS Pro results in "" values for 90% of the records

texts:
I'm new to ArcGIS and in over my head. I'm trying to join a shape file with a data table. The data table contains a calculated value I created in Excel. I thought this was going to be an easy, 5 minute task. I've been at this for days.

The files pertain to municipal housing issues. There are three particularly relevant fields:

FullAddress: roughly 60k records. Letters and numbers.
CommonField: roughly 30k records. The common field can have more than one Full Address. Made up of letters and numbers as text so the values containing something other than numbers are left-justified and the pure numbers are right-justified.
BldAddress: a concatenation of House and Street (contains the same data as FullAddress but for the Unit field and created by concatenation rather than stripping out the Unit values from FullAddress).
UnitsPerBuilding: roughly 17k records. The is the calculated field I’m trying to import and simply displays how many Full Addresses exist for each building. This field can have more than one CommonField and Full Address. Only numbers.

All I want to do is import one number field as a metric for housing density.

The problem is that the majority of the fields (roughly 90%) turn up as "". I have been unable to discern any pattern for this, other than the fact that about 90% of the non-Null values successfully imported are clustered conspicuously in one corner of the municipality.

Both the shapefile and the table originate from same municipality (the Shape file downloaded as a shapefile, and the data table downloaded as a CSV spreadsheet). It looks like the problem might be that the fields are not properly formatted. Unfortunately, I have been utterly unsuccessful despite days of trying to format the data table fields. I have tried importing the table as an XLS or a CSV file; importing into ArcGIS with and without the import tool (XLS to Table); "importing" a CSV or XLS* file into Excel rather than double click to open. The common field to join contains both letters and numbers and therefore it needs to be formatted as text. I have done that many times, and experimented with formatting the other fields as text, general, number.

I was advised the common field is 11 characters but the values range in number of characters. So I have tried padding the values with zeroes up to 11 characters but that also failed. Despite all these attempts at formatting, they make little difference: I recently compared the two attribute tables of the two files and have discovered:

The shapefile is mostly text fields, all text fields are unchecked for “Allow Null” field and range in length from 4 to 90 characters. The Common Field is formatted as a text field of 11 characters.
For the data table, I’ve imported as few as two fields and had the same result. CommonField was a text field up to 8000 (eight thousand) characters and UnitsPerBuilding is a long numeric of unspecified length, despite being formatted the same in the table prior to importing.

I have made sure that all field names are upper case and only contain letters and numbers (no spaces or other characters).


texts:
I am building a style to work with vector tiles.

My road geometries are many linestrings in a single layer.

I want to style the roads by rendering a casing, fill and centreline from one geometry.

I have a style that looks like:-

 var style = function(feature,resolution) {

        var line_casing_stroke = new ol.style.Stroke({color : '', width : 1, lineCap : 'round'}),
            line_fill_stroke = new ol.style.Stroke({color : '', width : 1, lineCap : 'round'});

        var style_array = [], length = 0;

            if (properties.layer == 'roads') {

                line_casing_stroke.setWidth(5);
                line_casing_stroke.setColor(colour_map.road.casing);
                line_fill_stroke.setWidth(4);
                line_fill_stroke.setColor(colour_map.road.fill);

                style_array[length++] = line_casing;
                style_array[length++] = line_fill;
        }

        return style_array;
 }

This creates a result as shown in the picture below which I think is caused by the lineCap: round in the casing style making the geometry a little but longer. Is there a way to get round this or a better approach? Note that I  CANNOT join the geometries in the vector tiles.


texts:
I want to add a WMS-Layer to QGIS.
If I try it, I get the following message:

  "Antwort nicht verstanden. Der wms-Provider sagte:
  Eigenschaften-Abfrage gescheitert: Connection closed"

It's a protected WMS, using https and basic authentication.
I have no problems to use the WMS-Layer in ArcGIS. There is no proxy.
Does anybody have an idea what's going wrong or where I can look for?
I'm using QGIS Desktop 2.0.1.
I can load and visualize other WMS-Services in QGIS (they use http).


texts: How can I cache reverse-geocode results?

texts: I'm implementing an Android application that needs to do some reverse-geocoding to resolve a geocoordinate to a city. What is the best way to cache this information on the smartphone so that I don't have to always call an online server to perform this reverse-geocoding?


texts: Using st_buffer to generate buffer away from edge of polygon

texts: I am trying to find which bike paths come into an area no closer than 500m but no further than 700m of Melbourne. I believe I will use an st_buffer to create a buffer around Melbourne (I  have a melbourne polygon) and see what bike paths (lines) are contained within. However I am not sure how to create a buffer with these requirements.


texts: How to set style for features within atlas feature

texts:
I have a vector layer with property parcels, and another vector layer separating them into regions. I have the regions layer controlling an atlas. I would like to have only the parcels within the current region colored for each atlas page.

This is the rule I applied to the parcels:

 contains(  buffer(  @atlas_geometry ,5),  $geometry )

But it doesn't work. With that enabled, none of the features show. What am I doing wrong?

Qgis 2.14


texts: Can Voronoi/Thiessen polygons be created using ArcObjects without 3D Analyst license?

texts:
Has any body used ITinNodeCollection to generate Voronoi/Thiessen polygons.
I have a point featureclass for which I want to create Voronoi/Thiessen polygons.

Does this require 3d analyst license?


texts:
I am trying to do a bathymetric map  for a lake using QGIS. However, I see no option to impose a mask so interpolation does not extending beyond the boundaries of my lake. I have traced around the lake (polygon) to which I would like to restrict the interpolation. Is there a "set mask" function in QGIS that would restrict all subsequent calaculations? I know how to convert the polgon to raster if needed. I have cliped to the lake boundaries but it still runs over. Do I need to go to GRASS to do this? Using version 1.8  on Windows 7.

Thanks

Alyre


texts: Joining attibutes by location + aggregation per field

texts:
I am  new to QGIS.

I have a point layer (water permits) and several buffer layers (different distances from WWTPs). I can use "join attibutes by location" and find out the number of points and the sum of one of the fields (water demand) within the areas, and so far so good.

However, I would like to aggregate water demand according to the values of another field (of the water permits layer) that describes the types of water users (industrial segment, cultures irrigated etc.). How can I do that without splitting the water demand layer by type of user? That's what first came to mind, but I guess there are clever ways to do it...

I'm using QGIS 2.18.18 (3.0 or later not running well here).


texts: How to create a stream graph with non-spatial data

texts:
The raw data would be like this:

I want to create a streamgraph with the width of the polygon being the amount in the certain date for the certain purpose, the output should be in shapefile format :

I don't know whether the transformation can be done with QGIS or ArcGIS, or I have to process the raw data with R


texts: How can I take a 'Slice' out of a 3D model using QGIS?

texts:
Subject line may not be the best description of what I'm trying to do.

Basically I want to take a 3D model of a group of buildings and either remove all points above a certain elevation, or preferably take a 'slice' by eliminating all points above and below a certain min and max elevation.

I just started using QGIS in conjunction with Agisoft Photoscan I know I would be left with no images of the tops of the buildings.  Essentially what is going on is many buildings have large roof overhangs or ground features (doorsteps, etc).  I want to estimate the dimensions of the buildings taken like 5 feet off the ground to effectively disregard the roof overhangs and the protruding features from the ground up to 5 feet.

Is this something I can do in QGIS?  If so, what type of file format would be best to import into QGIS for this purpose and what's the basic workflow?


texts: Global raster data in Equal Earth projection (EPSG:8857) in QGIS

texts:
I am trying to use the global GEBCO grid in an Equal Earth projection (EPSG 8857) in QGIS. However, no matter what I do, reprojecting it or clipping it, QGIS always "adds" these corner parts to the map. For example, this does not happen using a Mollweide projection.
Has anyone an idea how to avoid this?


texts:
I have successfully created a data extract widget. It works great.

I would now like to be able to set a limit say of 5000sqm or something.

I have seen other sites do this. They have a message pop up saying:

  you have exceeded the size limitation, reduce your area of interest.

Looking for some sugestions on how to achieve this.

here is some examples of sites that do what I would like to achieve

http://www.myplan.ie/viewer/

http://maps.aucklandcouncil.govt.nz/aucklandcouncilviewer/

We are an ESRI site, using Flex 3.6 viewer and Flex SDK 4.6. Hope that makes sense.


texts:
Anyone know what versions of Python Mapnik is compatible with?

I'm having trouble getting Mapnik to work. I'm thinking it might be because I am on 64-bit Win 7 and installed the 64-bit Python (v2.7)

I looked on the Mapnik docs/wiki but didn't find any info. Any thoughts? Will Mapnik only work with 32-bit Python? Is there a 64-bit Mapnik (couldn't see it).


texts: Get lattitude and longitude from geotiff file in javascript

texts:
I need to get lattitude and logitude (geo location) information from geotiff files in javascript.

I am currently using angular 1.x technology to develop geo friendly application.

Please let me know if we have any other third party libraries to get geo information from tiff format files.


texts: Transfering vector Style classification into Attribute table in QGIS?

texts:
I have a shapefile with a few thousand shapes, each with a specific value. Using Graduated classifcation, I can classify these shapes into ten categories based on value ranges. I'd like to use these 10 categories for statistical calculations. To do this I need to pull these categories into the Attribute table.

Is there a way a that this can be done, without manually doing the classification with From-To values in the the field calculator?


texts: Find minimum in a column of attribute table using python on Field Calculator

texts:
I have a column X in attribute table where the values are repeated in some lines. What I need is to make a condition that says: when the values in column X are the same, find the minimum of column Y and write it in a new column.

My attribute table is something like this:

My knowledge in python is very limited. I'm trying the code below but it's not working, has a syntax error, and if I put "if" instead of "elif" it works but results 0 in all lines, and what I want is to write "Y" or "0" in each line.

def func (code,w,ataq):
 Y=w*ataq

 if X == 0:
     return 0
 else:
     if X == X + 1:
      m=min(Y)
      elif Y == m:
          return Y
     else:
         return 0

The problem is in the incrementation of X. How can I do this differently?

UPDATE
Now I'm trying this code on python window:

import arcpy
featureClass="C:\\Users\\andreia.medeiros\\Documents\\ArcGIS\\Trabalho\\Modelo\\linhas_150_5km.shp"
data=arcpy.SearchCursor("linhas_150_5km","","","Line_code;w_min;ang_ataque","Line_code;w_min;ang_ataque")
import collections
d=collections.defaultdict(list)

for Line_code,w_min,ang_ataque in data:
    d[Line_code].append(w_min*ang_ataque)

But there's something wrong with "data". When I print "data" it shows "geoprocessing cursor object object at 0x1DAED2A0"
And I have a TypeError: 'Row' object is not iterable

Any help to figure it out what is wrong here?


texts: QGIS Browser panel not recognising .ers files

texts:
I'm trying to bring in an .ers file to do some 3D viewing.

I can see the .ers and associated files in Win File Explorer but they are not appearing in the Browser Panel. I can however see them in the folder when opening Directory Properties in the Browser (so they are actually there and are recognised) but not showing in the Panel itself.

Permissions are RW same as rest files. Not much else in here that can give hint on problem. All other files (.pdf,.txt,.jp2,.shp) in this folder are visible.

PC is 64 bit running Win 10, 2.18.3 QGIS with files accessed off an external drive. I have tried it off a thumb drive and from C drive with no success. File extensions seem to be .ers, .isi and .xml.

Haven't came across this before and strange as all other files are recognized as far as I can tell (.tab,dat,bmp, etc....).

I know there is a Hide from Browser function however that hides the whole folder not the files. Have tried rebooting. Have searched but question doesn't appear to have come up before.


texts: GeoTools CollectionFeatureSource Disk Cleanup

texts:
I am using GeoTools to load a GeoJSON file into a PostGIS table.

My code looks like this:

        FeatureJSON featureJSON = new FeatureJSON();
        File geojsonFile = getFile(dataResource); // Loads the GeoJSON as a File
        SimpleFeatureCollection featureCollection = (SimpleFeatureCollection) featureJSON.readFeatureCollection(geojsonFile);
        SimpleFeatureType featureSchema = featureJSON.readFeatureCollectionSchema(geojsonFile, true);
        FeatureSource<SimpleFeatureType, SimpleFeature> geojsonFeatureSource = new CollectionFeatureSource(featureCollection);

Once I get the geojsonFeatureSource I can then use this to load the data into PostGIS using a DataStore object for PostGIS.

My problem occurs when I try to delete the GeoJSON file afterwards (held by the geojsonFile variable in my example). This file has a lock on it and cannot be deleted.

Now, when using previous Data Stores (such as Shapefiles) I am always able to call .dispose() on the FeatureSource. However, in this GeoJSON case, I am not able to call .dispose() on the CollectionFeatureSource because it is an "In Memory Data Store" - whatever that means.

My cleanup logic looks like:

            featureJSON = null;
            geojsonFeatureSource = null;
            featureCollection = null;
            featureSchema = null;
            geojsonFile.delete();

How can I get these objects to release their lock on the GeoJSON file so that I can clean up this input GeoJSON file?


texts: QGIS 2.12/14 Add GPS Point missing geography?

texts:
I am trying to use the integrated GPS module from QGIS to add data points  to a shapefile while in the field. I managed to get the connection between qgis and the gps working and my location is shown on the map inside QGIS. When I create a new point shapefile, selecting UTM Zone 32N and add a point over the GPS module, a point is added to my shapefile but when I try to zoom to the points I receive the error message "missing geometry". When I try to add a track it works fine.

I have tried using QGIS 2.12 and 2.14 on several different computers with Win 7 and Win 10 and using different projections. While searching for the problem i have not found any solutions.

EDIT:
Problem was fixed in the 2.14 LTR and the Versions since 2.16


texts: Does anyone know of sources for downloadable global composite NDVI datasets (2-week to 1 month composites) that include more recent data than 2006?  The GLCF (http://glcf.umiacs.umd.edu/data/gimms/) and USGS (http://eros.usgs.gov/#/Find_Data/Products_and_Data_Available/NDVI) composite AVHRR data is available through 2006, but in a cruel twist of fate, I need data for 2007.  My area of interest is NW Siberia, so I don't necessarily need global coverage if anyone is aware of more geographically specific data.  Thanks in advance.


texts: GeoJSON data not getting displayed on Openlayers map in Geodjango

texts:
I have the following code.

models.py

class PFT(models.Model):

    species=models.CharField(max_length=50)
    geom = models.PointField(srid=4326)
    objects=models.GeoManager()
    def __str__(self):
        return '%s %s %s' % (self.species, self.geom.x, self.geom.y)

views.py

def geojson_provinces(request):
    conn = psycopg2.connect(dbname="geodjango",host='localhost',user='postgres', password='postgres', port=5433)
    dict_cur = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
    cur=conn.cursor()
    res = dict_cur.execute("SELECT ST_AsGeoJson(geom) AS json FROM pft_pft LIMIT 10;")

    points=dict_cur.fetchall()

    json_res  = []
    for row in points:
        json_obj  = row['json']
        json_res.append(json_obj)
        print(json)
    #json = simplejson.dumps(data)
    dict_cur.close()
    return render_to_response('map.html',
                          {'json_res': json_res},
                         context_instance=RequestContext(request))

urls.py

url(r'^geojson/$', geojson_provinces, name='geojson_provinces'),

Javascript code in map.html

<script>

    var map = new ol.Map({
       layers: [
          new ol.layer.Tile({
             source: new ol.source.OSM()
          })
       ]
       , target: 'map'
       , view: new ol.View({
          center: [0, 0]
          , zoom: 2
       })
    });

    var vectorSourceJsonp = new ol.source.Vector({
       format: new ol.format.GeoJSON()
       , loader: function(extent, resolution, projection) {
          $.ajax({
             url: "{% url 'geojson_provinces' %}"
             , dataType: 'jsonp'
          });
       }
       , strategy: ol.loadingstrategy.createTile(new ol.tilegrid.XYZ({
          maxZoom: 19
       }))
       , projection: 'EPSG:4326'
    });
    // Executed when data is loaded by the $.ajax method.
    var loadFeatures = function(response) {
       vectorSourceJsonp.addFeatures(vectorSourceJsonp.readFeatures(response));
    };
    // Vector layer
    var vectorLayerJsonp = new ol.layer.Vector({
       source: vectorSourceJsonp
       , style: new ol.style.Style({
          stroke: new ol.style.Stroke({
             color: 'green'
             , width: 2
          })
       })
    });
    var mapJsonp = new ol.Map({
       target: 'mapJsonp'
       , renderer: 'canvas'
       , layers: [osmLayer, vectorLayerJsonp]
       , view: new ol.View({
          center: [-75.923853, 45.428736]
          , maxZoom: 19
          , zoom: 11
       })
    });

</script>

When I run http://localhost:8000/geojson only map is getting displayed but not the GeoJSON data as points.


texts: Direction of Input ID to Target ID layers in QGIS

texts:
I've got a distance matrix with entities with an Input ID, target ID, and distance. I'm looking for a way to find out the relative direction of the input ID columnn to the target ID column.
Question has been answered and works, but this question has alternative solutions for anyone who is looking for a similar process.


texts:
I have edited a GUI in QT of a plugin and made changes to the code. Have exported the correct ui.py files and files paths within the python elements of the plugin, look to be correct.

However, I cannot load the new version, it remains the same as the old one with NO changes.


texts: How to run a moving window function in a conditional statement in PostGIS for buffer artifact removing?

texts:
I try to remove the artifacts which occur when running the ST_Buffer function in PostGIS PostGIS 2.5.1 (See picture). For this case I wrote a function that should loop trough every segment (row) and erase (ST_Difference) the Polygons with the smaller areas (I assume the "normal-shaped") from the bigger ones (With additional artifacts).

--CREATE TABLE line(name char(10), geom geometry);
--INSERT INTO line VALUES('line','LINESTRING(0 0,30 10,40 30,70 40)');

WITH firstblocks AS(

SELECT  row_number() Over() AS id, ST_Buffer(ST_Line_Substring(the_geom, 8*n/length,
  CASE
    WHEN 8*(n+1) < length THEN 8*(n+1)/length
    ELSE 1
  END),4, 'endcap=flat join=mitre mitre_limit=3.0' ) As the_geom

FROM
  (SELECT
  ST_LineMerge(geom) AS the_geom,
  ST_Length(geom) As length
  FROM line
  ) AS t

CROSS JOIN generate_series(0,CEIL(length/8)::int) AS n
WHERE n*8/length < 1

)

--Erase the smaller geometry from the bigger one
SELECT
    CASE
        WHEN ST_Area(the_geom) <= ST_Area(lead(the_geom) OVER(PARTITION BY id ORDER BY id))
        THEN ST_Difference(the_geom, lead(the_geom) OVER(PARTITION BY id ORDER BY id))
        ELSE ST_Difference(lead(the_geom) OVER(PARTITION BY id ORDER BY id), the_geom)
    END AS new_geom
FROM firstblocks;

The code works but loading the data as a new layer in the QGIS-Database Manager throws out the error: There was an error creating the SQL layer ...
Somehow I am struggling with the conditional statements, while using a moving window approach. How can I combine them successfully?


texts: Rotating a set of coordinates around a point

texts:
Based on the user's location I want to draw a circle that passes a given coordinate X (so the radius will be the distance from the user location to X).

Based on this
https://smilebasicsource.com/forum?fpid=7022

I managed to get a solution that works, but when I check the points I get a ellipse and not a circle.

Can anyone tell me why?

//The following code rotates with 1 degree each time its run. after 360 times I get the circle (ellipse) below.

var R = 0.0174533; //1 degree
var X = World.obj.locations[0].longitude;
var Y = World.obj.locations[0].latitude;
var CX =  World.userLocation.lon;
var CY =  World.userLocation.lat;

var C = Math.cos(R);
var S = Math.sin(R);

var DX = X - CX;
var DY = Y - CY;

var NX = CX+DX*C-DY*S;
var NY = CY+DX*S+DY*C;

World.obj.locations[0].latitude = NY;
World.obj.locations[0].longitude = NX;


texts: column is of type polygon but expression is of type geometry

texts:
I am trying to save the coordinates of polygon drawn in google map into postgis as polygon datatype.

currently coordinates are JSON type.

But drying manager is not giving me the coordinates of last point and this is correct because in polygon the coordinates of last point is same as first point. For ex- the coordinates are-

  {"type":"polygon","coordinates":[[40.48873742102281,-94.471435546875],[39.66491373749128,-94.7021484375],[40.17047886718109,-93.548583984375]]}

Here drawing manager is not giving the coordinates of last point which is same as first point, so while saving them in postgis, the error is-

column "column_name" is of type polygon but expression is of type geometry

I am using-

"INSERT into table_name (column_name) VALUES (ST_GeomFromGeoJSON('".($coordinates) ."'))";

column_name is of polygon type.

Edit- Code used to create polygons-

drawingManager.setMap(map);
    google.maps.event.addListener(drawingManager, 'overlaycomplete', function(polygon) {
var coordinates_poly = polygon.overlay.getPath().getArray();

    var lat_poly = [];
    var lng_poly = [];
    var Coordinates = [];
    for(var i = 0; i <coordinates_poly.length; i++){
    lat_poly = coordinates_poly[i].lat();
    lng_poly = coordinates_poly[i].lng();
    Data = [lat_poly,lng_poly];
    Coordinates.push(Data);
    }
    var JSON_Coordinates = JSON.stringify(Coordinates);
    document.getElementById("data").value= "{\"type\":\"polygon\",\"coordinates\":" + JSON_Coordinates +"}";
    });
    }

Where "data" is form element.

Someone please help me how to save coordinates as polygon type.


texts: Which version(s) of ArcGIS API are compatible with ArcGIS 10.2?

texts:
I'm working on an older Esri-Silverlight4 solution and trying to use services in ArcGIS 10.2.

A lot of it works, but I'm seeing some different behavior(10.0 was much more lenient with its parameters) and it occurred to me that ArcGIS API for Silverlight v2.4 might not be compatible with ArcGIS 10.2.

Is there matrix list somewhere on esri.com that shows compatibility between ArcGIS Server and Silverlight clients?


texts: Calculating twists/turns of vector line using QGIS?

texts:
I currently have a large layer (trails) and want to calculate for each trail how much the trail turns or is distorted between the start and end of the trail.

Is this possible on QGIS 3.6.2?


texts: Grid shift transformations based on GSD and GDX files (like cs2cs does)

texts:
My main goal is to achieve the same conversion as to the following command using geotools.

cs2cs -f "%.7f" +init=epsg:23700 +nadgrids=etrs2eov_notowgs.gsb +geoidgrids=geoid_eht2014.gtx +to +init=epsg:4258

Basically I would like to convert points from EOV to ETRS89 with high precision, so I would like to use correction grids.

So far I created the following java program:

public static void main(String... args) throws Exception {
    initialize();

    CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:23700");
    CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:4258");
    MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS);
    checkTransform(transform);

    DirectPosition2D srcDirectPosition2D = new DirectPosition2D(sourceCRS, 650000, 180000);
    DirectPosition2D destDirectPosition2D = new DirectPosition2D(targetCRS);
    transform.transform(srcDirectPosition2D, destDirectPosition2D);
    System.out.println(destDirectPosition2D);
}

private static void checkTransform(MathTransform transform) throws Exception {
    if (!transform.toString().contains("NTv2")) {
        throw new Exception("Latitude and longitude difference file not loaded.");
    }
}

private static void initialize() {
    System.setProperty("org.geotools.referencing.forceXY", "true");
    ReferencingFactoryFinder.addAuthorityFactory(new WKTOperationFactory("transform_overrides.properties"));
}

My transform_overrides.properties looks the following:

4258,23700=PARAM_MT["NTv2", PARAMETER["Latitude and longitude difference file", "etrs2eov_notowgs.gsb"]]

These are the two files that are needed for the conversion:

http://www.agt.bme.hu/on_line/etrs2eov/etrs2eov_notowgs.gsb
http://www.agt.bme.hu/on_line/etrs2eov/geoid_eht2014.gtx

My problem is that the source point (650000    180000) is not converted to the desired CRS (should be: 19.04745712900    46.96421283181).


texts: Loading GeoServer WMS raster layer in QGIS Python console

texts:
I am using the following snippet to load a raster layer deployed under wms service using geoserver, in qgis python console. I am getting False output. Any idea?

registry = QgsMapLayerRegistry.instance()
urlWithParams = "service=WMS&version=1.1.0&request=GetMap&layers=sf:sfdem&styles=&bbox=589980.0,4913700.0,609000.0,4928010.0&width=512&height=385&srs=EPSG:26713&format=image/png&url=http://maps.itu.edu.tr:8082/geoserver/sf/wms?"
rlayer = QgsRasterLayer (urlWithParams , "my_title", "wms")
rlayer.isValid()

I have tried this, How to load a WMS layer using PyQGIS?, and good enough web hunt but can't understand the issue. Is there any way to generate error code or info while working on qgis console?


texts: In QGIS 2.18 it was possible to download vector data from OpenStreetMap by going into Vector>OpenStreetMap>Download Data. How can we go about this in QGIS 3.0?


texts: The GIS of War - Tracking Conflicts and Their Effects

texts: I was idly speculating on the many sorts of things people are keeping track of these days with GIS - natural/human catastrophes, demographic and economic patterns, climate change, etc. In that vein, I started to look around for GIS' applications in war and international conflicts.  There are many obvious uses for it in the military, but is there any database or publicly accessible application that organizes war-related information in a spatial and/or cartographic context? Time would undoubtedly play an integral role in any robust methodology. The most I was able to find was an in-progress database for tracking war crimes. What else is out there for public consumption, if anything?


texts: arcpy SearchCursor always empty at each loop when inserting new rows with InsertCursor

texts:
I am inserting new rows into a POINT FeatureClass within a geodatabase.
The way I do it is by creating an InsertCursor over an empty FeatureClass and inserting new rows while loopinf through the values of a table using a SearchCursor. At the beginning of each loop, I need to be able to create a search cursor on the FeatureClass, which, at the bigninning of the second loop for example, should contain one row. However, it is always empty. I guess it might be a problem of the InsertCursor not refreshing itself at each loop, making the creation of the SearchCursor to the FeatureClass to be always empty.

Below is my code. Basically, at line 6, search_fc seems to be always empty causing the next line (for elem in search_fc) to be False and the for loop to be skipped (the debug goes directly to line 14 (the if statement)). This should ONLY happen at the beginning, when output_fc is empty.

    with arcpy.da.InsertCursor(output_fc, fields) as fc_cursor:
        table_field = [IDfield, ADDRESSfield]
        table_cursor = arcpy.da.SearchCursor(address_table,table_field)
        for row in table_cursor:
        try:
            search_fc = arcpy.da.SearchCursor(output_fc,fields)
            for elem in search_fc:
                if row[1] != elem[1]:
                    continue
                arcpy.AddMessage("Address {0} already geocoded".format(row[1]))
                field = [row[0],row[1]] + elem[2:]
                fc_cursor.insertRow(field)
                break
            if not row[1] in [elem[1] for elem in search_fc]:
                arcpy.AddMessage("Geocoding {0}".format(row[1]))
                print 'Geocoding ' + row[1]
                address_google, latitude, longitude, precisione = geocode(row[1])
                xy = (longitude,latitude)
                field = [row[0],row[1],address_google,precisione,xy]
                fc_cursor.insertRow(field)
                count = scriviglobal(today)
                sleep(WAIT_INTERVAL)
        except Exception as e:
            print e.message
            sleep(WAIT_INTERVAL)
        finally:
            print 'something'


texts: Unclosed linestring to polygon works with QGIS but not with PostGIS

texts:
Just like the title, I am extracting OSM riverbank and a lot of riverbanks in OSM is in 'unclosed' linestring.

This is the original river shape i extracted from OSM

In order to polygonize the linestring, I tried to use ST_MakePolygon (or Polygonize); yet, it says the linestrings are not closed and it cannot make polygons in some areas.

select st_makepolygon(st_makevalid(shape)) as shape from asia_waterway_line where waterway ='riverbank'
and st_isclosed(shape)

However, I just ran with QGIS Polygonize tool in vector tool and it gives me a polygon that I want to make.

Polygonize of GRASS, SAGA brought me weird polygon (I'm just giving you other trials that I tried)

Because all my data are stored in postgresql, I really do want to make them working using PostGIS Spatial Query.
I tried with someone's ST_ForceClosed function but it didn't work either.
Is there any ways that I can solve this issue?

I extraxcted waterway using osmosis tag info and imported them using ogr2ogr.


texts: qgis2web Leaflet zoom level on geolocation

texts:
I'm using the qgis2web plugin to create a Leaflet web map. All is working well except that when using geolocation, the map zooms in too much on the device location. Zooming out is only temporary as the map seems to zoom back in on the geolocation accuracy circle.

I have looked for a solution but can't seem to find one and looking through the js or the html files and online documents didn't get me closer to a solution.

Any idea how to resolve this issue?


texts:
I am working on a project which has multiple data formats like GPX, OSM etc
Now the code I have to work on has input data in a different format than these two like below:
624029,41.879176,-87.649627,1301806255.0,None,624042
624042,41.879172,-87.649875,1301806259.0,624029,624058
624058,41.879171,-87.6502,1301806262.0,624042,624077
624077,41.879166,-87.650524,1301806265.0,624058,624115

The first is the id of the location,next are lat, long, time, id for previous location, id for next location. I understand this is being done to have some sort of a connectivity from point to point.
I have come across code which appends all these traces across multiple trip files to an all_trips file. I have a different format for trips though which is GPX that goes like this
How do I make sense of this and how do I establish similar connectivity like the previous text data ?


texts: Removing all labels in KML file but leaving placemarks

texts:
I have around 4000 placemarks on Google Earth and have colored them red or green according to whether they qualify for a particular criterion or not. I have also given names to the placemarks accordingly. Now I want to save the image of the area with just red and green color of the placemarks shown without any name of the placemarks. For this it appears that I need to put all the red color placemarks in one folder and green ones in the other folder and reduce the opaqueness of lables to 0%. But since I have a lot of points and it would be tedious to do it manually.

So is there any other faster way to do it ?


texts: TIFFDirectory.getAsMetadata() is not including GeoTIFFTagSet. Any solution to this problem? -- JAI

texts:
The source code appears to simply copy the TagSet List object to the IFD and then the TIFFMetadata. I don't understand where it is losing the tagset as it is in the list before the call.

Anyone encountered this problem and have any ideas?

relevant source code:

https://github.com/dcm4che/jai-imageio-core/blob/master/src/main/java/com/sun/media/imageio/plugins/tiff/TIFFDirectory.java

https://github.com/dcm4che/jai-imageio-core/blob/master/src/main/java/com/sun/media/imageioimpl/plugins/tiff/TIFFImageMetadata.java


texts: Testing for Complete Spatial Randomness in QGIS

texts: Is there a way (plugin/processing tool) to test a point pattern for complete spatial randomness (CSR) in QGIS?


texts: GeoServer: Combining multiple raster stores into one WMS layer

texts:
I would like to publish a DTM as WMS using GeoServer. For the visual part I have a hill-shaded version of the DTM and the original DTM contains the height as floating points (level above sea). Combining these two datasets I would like to create one WMS layer in which:

GetMap returns the requested BBOX from the hill-shaded dataset.
GetFeatureInfo returns the height at the specified point from the original DTM.

Is this possible in GeoServer or are there alternatives which could solve this?


texts:
I set a iterator to create two categories of feature class, and then join and dissolve them. The calculation works fine. However, the running result never shows completion even when the calculation finishes (show in the 2nd pic).

I tested the model by replacing the iterator with one feature class and changing the outputs' names from "%Name%" to "aa". The model finished without any problem. Therefore I guess the problem lies in the iterator.

I cannot understand why the model comes back to the iterator again when the calculation finishes. How could I solve it? Or it is a bug?


texts: Wrong coordinates after resizing the map

texts:
I catch a click event on openlayers map and show a popup with featureinfo (if any) with position set as map.getLonLatFromPixel(new OpenLayers.Pixel(e.xy)). The user might set the map to show in fullscreen with a button, a little of JS code and some css styling:

#geomap_f, #mapbox_f {
    background: white;
    position: fixed !important;
    left: 0;
    top: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 49;
}

The problem arises when the user clicks the fullscreened map. The geoserver throws org.geoserver.platform.ServiceException: 979, 8330 not in dimensions of image: 1017, 943 and e.xy object holds some really huge numbers (979, 8330 in this case). I know I need to tell the map or the geoserver (or both) that the mapsize was changed and that I want them to recalculate the relationship between xy and latlon. I've tried using some of OpenLayers.Map methods with no success so far though.
How can it be done? Do I need to resize the map differently? I already call map.updateSize() after resizing, that doesn't seem to influence the coordinates.


texts: How to Create Animated Cluster Markers in OpenLayers/Leaflet?

texts:
I want to use Leaflet due to the smooth transitions which Openlayers seems like they can't match. I specifically require the ability to cluster markers with custom styled marker groups.

The best example which demonstrates what I am trying to achieve can be found at Redfin.

Please notice hovering over a cluster provides for a slick animation and by clicking on a marker the clusters split apart with an animated effect. When reaching a zoom level where individual points don't overlap with a given tolerance the actual markers split out to their locations in an animated fashion.

I really would love to integrate similar effects to these and would appreciate some guidance on the best approach or other examples you might be aware of.

Note: Redfin seems to be using Flash which I want to stay away from. In an ideal situation I would like to achieve this through Javascript if possible but think it probably needs to be done through HTML5/canvas.

Maybe the use of p. - Raphael.js or d3.js

Any ideas?

BTW - found this example but it seems to specifically apply to Google Maps.


texts: How to get the coordinates of the starting and ending points of a line in ol.interaction.Draw in OL3

texts:
I'm using Openlayers3 for drawing and storing lines, and then doing some processes on the inputs. Now I want to get the coordinates of the starting and ending points of the line while the line is being drawn. In other words, as the user clicks to start the line the coordinates of the starting point being collected and do some process. When the last point is inserted the same thing happens. I have read so many answers here mostly referring to OL2 and I also read the OL3 documents, but seems something is not right.
Here is part of my code:

draw.on('drawstart', function(e1) {
var mouseCoordinatesStart=map.getEventCoordinate(e1);
infoBox.innerHTML = 'you just started to draw at:
' + mouseCoordinatesStart;});

draw.on('drawend', function(e2) {//I have tried the same process as the drawstart but the results are the same. here I just want to show I tried different methods.
var mousePixel= map.getEventPixel(e2);
var mouseCoordinatesEnd=map.getCoordinateFromPixel(mousePixel);
infoBox.innerHTML = 'drawing endded at:
'+ mouseCoordinatesEnd;});

it seems that the function for handling the drawstart works for the first time  but then the drawend event does not change the coordinates. However, if I zoom out or in then the coordinates change but then I guess it's not the coordinates of the endpoint of the line.
Could someone help me with this issue?


texts: Lat Lng Search Along Line from Direction (Geographic North)

texts:
Most of the lat lng searches are for POIs within a radius. How does one define POIs+(margin of error) that are along a (infinite) straight line (or geodesic or great sphere) defined by a north direction, from a certain lat lng?
From
Origin: (lat,lng)
Direction: North (Degrees)

Determine
POIs along line defined by above boundaries, with a margin of error (+/- 50 m, given GPS inaccuracies)


texts:
I am currently working on two-scan raster algorithms (euclidean distance transformations, cost surface analysis, etc.). Those algorithms require a line-wise forward raster scan (from top left to bottom right) as well as a backward/reversed raster scan (from bottom right to top left).
I am currently using GDAL to read the raster data using the C++ code provided by the tutorial.
float *pafScanline;
int   nXSize = poBand->GetXSize();
pafScanline = (float *) CPLMalloc(sizeof(float)*nXSize);
poBand->RasterIO( GF_Read, 0, 0, nXSize, 1,
                pafScanline, nXSize, 1, GDT_Float32,
                0, 0 );

The RasterIo method reads the raster as scanlines into dynamically allocated memory (provided by CPLMalloc) and it does so from left to right. Up to now I did not find any GDAL methods to read a raster scanline from right to left (eg. backwards).
My question: Is there any better method to achieve a backwards raster scan than reading the scanline from left to right and then reorder the values (which would mean that the scanline has to be processed twice)?


texts:
I have a raster that I can't open in QGIS. When I load the raster, I get the following message:
CRITICAL Capa no válida: GDAL provider cannot open GDAL dataset C:\Users\Name lastname\Destktop...

Raster layer El proveedor no es válido (proveedor:gdal, URL: C:\Users\Name lastname\Desktop...

I must say that I can open the raster in other laptops but not mine... so that means, the file is ok. I’m running windows version...and I’ve had the issue with the 3.18.2 and 3.16.4 as well.


texts: Using Python to combine middle parts of two fields into third field

texts:
Below is how I used the Update Cursor in my final script. As you can see getValue was used a few times, perhaps there is a cleaner way to do this? But my concatenated field wouldn't populate properly otherwise.

    sourceRows = arcpy.UpdateCursor(inFeatures)
    source = sourceRows.next()

    while source:
        fieldString1 = source.getValue(fieldName1)
        fieldString2 = source.getValue(fieldName2)
        concatString= (str(source.getValue(fieldName2))[1:7] + str(source.getValue(fieldName1))[1:7])
        source.setValue(fieldName3, concatString)
        sourceRows.updateRow(source)
        source = sourceRows.next()
    del source, sourceRows

I have a script that creates three fields in a feature class. The script adds the X and Y coordinates to the first two fields. I would like data found in the middle parts of the first two fields to populate the third field. Does anyone know how to find the middle part of a field using Python? I see where VBScript seems to have a MID function but I haven't found anything for Python yet. Below is what the third field (fieldName3) should look like.

fieldName1     fieldName2   fieldName3
12345.321       36789.321   67892345
24680.5425      98765.432   87654680

Do you see how I want data to be combined in fieldName3? Below is the script as I have it now.

import arcpy
from arcpy import env
arcpy.env.overwriteOutput = True

env.workspace = "D:/gisfiles/test.gdb/"

inFeatures = "fc"
fieldName1 = "xCoord"
fieldName2 = "yCoord"
fieldName3 = "Combined"
fieldPrecision = 18
fieldScale = 11

expression1 = "float(!SHAPE.CENTROID!.split()[0])"
expression2 = "float(!SHAPE.CENTROID!.split()[1])"

arcpy.AddField_management(inFeatures, fieldName1, "DOUBLE", fieldPrecision, fieldScale)
arcpy.AddField_management(inFeatures, fieldName2, "DOUBLE", fieldPrecision, fieldScale)
arcpy.AddField_management(inFeatures, fieldName3, "DOUBLE", fieldPrecision, fieldScale)

arcpy.CalculateField_management(inFeatures, fieldName1, expression1,
                            "PYTHON")
arcpy.CalculateField_management(inFeatures, fieldName2, expression2,
                            "PYTHON")

sourceRows = arcpy.UpdateCursor(inFeatures)
source = sourceRows.next()

while source:
        **#Instead of 12345 I need an expression to combine fieldName1 and fieldName2**
        source.setValue(fieldName3, "12345")
        sourceRows.updateRow(source)
        source = sourceRows.next()
del source, sourceRows


texts: Python add-in: pass selected layer of combo box to a button

texts:
I want to list layer names in a combo box and pass the selected layer name to onclick of a  button.
I could list the layer names in combobox but i don't know how to pass the name to a button. How can i solve the issue?
import arcpy
import pythonaddins

class ButtonClass2(object):
    """Implementation for test_addin.button (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):

        pass

class ComboBoxClass1(object):
    """Implementation for test_addin.combobox (ComboBox)"""
    def __init__(self):
        self.items = ["item1", "item2"]
        self.editable = True
        self.enabled = True
        self.dropdownWidth = 'WWWWWW'
        self.width = 'WWWWWW'
    def onSelChange(self, selection):
        pass
    def onEditChange(self, text):
        pass
    def onFocus(self, focused):
         # When the combo box has focus, update the combo box with the list of layer names.
    if focused:
        self.mxd = arcpy.mapping.MapDocument('current')
        layers = arcpy.mapping.ListLayers(self.mxd)
        self.items = []
        for layer in layers:
            self.items.append(layer.name)
    def onEnter(self):
        pass
    def refresh(self):
        pass


texts: Select point features using spatial query

texts:
I have two postgres tables, one polygon features and second point features, having same projection.
What i want to do is to select only the points which contains in large polygon and does not contain in the small polygons, as highlighted in the picture below , using spatial query.

I am trying to do with the below query is to, select all the points which does not intersect/contain in the small polygon (kind=1) and then return those points from the selected features which contains in the large polygon (kind=2).
The query results in to 0 rows.

select
      *
 from
    (
     select p.geom as point_geom,sp.geom as polygon_geom
     from polygons sp, points p
     where st_disjoint(sp.polygon_geom,p.point_geom) and sp.kind = 1
    ) as subquery
 where st_contains(subquery.scale_geom,subquery.pois_geom) and subquery.kind = 2;

The kind column in the above query is used to differentiate between these polygons, where kind = 1 represents the small polygon and kind = 2 the large polygon. Also both polygons overlaps which means the points contain in small polygon also contains in large polygon.


texts: Updating legend (when active layer is changed) in CARTO VL?

texts:
I have made a CARTO VL map that allows the user to update the active layer depending on which groundwater aquifer option is selected.

The layers have different Sources, but use the same Viz. For example:

const fracturedSource = new carto.source.Dataset('fractured');
const intergranularSource = new carto.source.Dataset('intergranularfractured');
const karstSource = new carto.source.Dataset('karst');

const aquiferViz = new carto.Viz(`
  color: ramp($yield_ls, reverse(temps))
  strokeColor: rgba(0,0,0,0.3)
  strokeWidth: 1
`);

const aquiferLayer = new carto.Layer('aquiferLayer', fracturedSource, aquiferViz);

When a different layer is selected, a function is triggered like so:

function setIntergranular() {
  aquiferLayer.update(intergranularSource, aquiferViz);
}

The layer updates as intended, but the legend remains the same. Is it possible for the legend to update as well? For extra reference, my legend is added using the following code:

// A function to convert map colors to HEX values for legend
function rgbToHex(color) {
    return "#" + ((1 << 24) + (color.r << 16) + (color.g << 8) + color.b).toString(16).slice(1);
}

// When layer loads, trigger legend event
aquiferLayer.on('loaded', () => {

    // Request data for legend from the layer viz
    const colorLegend = aquiferLayer.viz.color.getLegendData();
    let colorLegendList = '';

    // Create list elements for legend
    colorLegend.data.forEach((legend, index) => {
        const color = rgbToHex(legend.value);

        // Style for legend items
        colorLegendList +=
            `<li><span class="point-mark" style="background-color:${color};border: 1px solid black;"></span> <span>${legend.key}</span></li>\n`;
    });

    // Place list items in the content section of the title/legend box
    document.getElementById('contentLegend').innerHTML = colorLegendList;
});


texts: Convert LineString to MultiLineString in Qgis Spatialite

texts: How to convert LineString to MultiineString layer in sqlite?


texts: Cache google map for offline use in leaflet

texts:
I am having an hybrid application where I am showing google map as base map with the help of Leaflet.GridLayer.GoogleMutant plugin in leaflet.

Now I need to cache the browsed base map tiles and show in offline mode. I have gone through few offline plugins from leaflet but they are compatible with TileLayer and the base map url (mostly OSM map). Please suggest some ways to cache google base map.


texts: ArcMap crashes when saving an existing project

texts: I am having issues saving an existing project on ArcMap 10.3. After adding another layer to the project, whenever I try to save the project, the software crashes and asks if I would like to send an error report. I have reset my application data but the error still persists and all other projects have started behaving the same way.


texts:
Can I use these libraries in OpenLayers v.4?

I'm specifically using 4.6.5 version and I would like to apply a search bar for example.

http://viglino.github.io/ol-ext/examples/search/map.control.search.html


texts: How to transform coordinates for a geometry in Javascript Topology Suite JSTS

texts:
I would like to transform coordinates of geometries in JSTS (Javascript Topology Suite).

I want to use a coordinate filter so I don't need to worry about what type of geometry is being transformed (e.g. polygon, multipolygon).

Docs here suggest I could use a CoordinateFilter https://bjornharrtell.github.io/jsts/doc/api/jsts.geom.CoordinateFilter.html

e.g. My filter function could look something like:

var filter = function(coord){
    coord.x += 100
    coord.y += 200
}

But these docs seem totally different to the compiled JSTS version on the demo page, version "1.6.1 (9be7f16)" https://bjornharrtell.github.io/jsts/

Since I expect to use version 1.6.1 from the demo page, any ideas how to perform the coordinate transform?

I understand that I could parse through all the various coordinates, linear rings, holes etc for each type of geometry but I am hoping I can create a generic coordinate transform function and apply it to any geometry.

Any ideas where I should be looking to achieve this?

-- Edit --

I managed to get this working with a hack... I'd still like to know how to do it properly by using the correct interfaces... My filter function now looks like this:

var transformCoordinatesFilter = {
  interfaces_: function() {
    // Hack to work around interface checks in jsts
    // This effectively ensures that any check for
    // this.interfaces_().indexOf(<some interface>) > -1
    /returns true
    // If only I could set the correct interfaces so this was not necessary
    return {
      indexOf: function() {
        return true
      },
    }
  },
  filter: function(coord) {
    coord.x += 100
    coord.y += 200
  },
}

featureToTransform.apply(transformCoordinatesFilter)


texts: Labeling features in given order in QGIS?

texts:
I want to sort the address numbers where would show only the bigger number and smaller value should be suppressed away.

I have used earlier ORDER BY-method when using PostGIS but now it isn't possible

How I can manage it using QGIS when labelling address numbers?

Number 17 (blue) and 46 (red) should stay and 3 (blue) and 6 (red) suppressed

The current situation where only the smaller address number exist, how to make this opposite?


texts: Disable map dragging ONLY when touch - sliding transparency slider

texts:
I am wondering if anyone knows how to replicate this, but specifically with touchscreens in mind:

//disable dragging when cursor is over the element
opacitySlider.getContainer().addEventListener('mouseover', function () {
    map.dragging.disable();
});
// Re-enable dragging when user's cursor leaves the element
opacitySlider.getContainer().addEventListener('mouseout', function () {
    map.dragging.enable();
});

It seems like when I search around, I find info on how to disable dragging entirely, or disable anytime on mobile -- I don't want to do that.

I have the functionality working well when it is linked to a mouseover event (example above) -- I just need to know how to do the same exact thing, but when an opacity/transparency slider is being engaged with on any kind of touch screen. This map is being designed for large, touchscreen digital signage.


texts: How to link latitude and longitude with GeoNames?

texts:
I have a .csv file having following informations:
ID, Latitude, Longitude, Altitude, Date, Time

I want to link the Latitude and Longitude information with GeoNames Linked Data.

So, I have searched for following:

From the GeoNames data dump in text files I have downloaded the country data (IT.zip). And from the particular GeoID, I am able to do the following query on SPARQL endpoint.

select * from http://sws.geonames.org/2759794/about.rdf where {
   ?s http://www.geonames.org/ontology#alternateName ?o;
   wgs84_pos:long "38.23005565";
   wgs84_pos:lat "15.5511188825967".
}

But, the latitude and longitude information that I have in my .csv file is not present in the IT.zip (country) file.

I am able to retrieve location name form the Google API, but the names are not present in the IT.txt file.

I want to know can I able to connect my data into Linked GeoData?


texts: Nearest neighbor analysis, write multiple columns to table

texts:
I have a table (table1) containing 800 points that I want to join with a table (table2) containing only 10 points. The idea is that the points in table2 are assigned to the points in table 1 based on nearest neighbor analysis. This can be easily done using, for example, the NNJoin plugin in QGIS.

However, this plugin only adds a column containing the distances to the nearest points to table1. But that's not what I need, for I want to add multiple columns with information from table2 to table1 based on the nearest neighbor analysis.

So in short, how can I add multiple columns filled with data from table2 to table1, based on nearest neighbor analysis?

Edit:

A small reformulation, to clarify things a bit: I want to add all attributes from table2 to table1, based on nearest neighbor analysis. So not only the distance, but also all other attributes from table 2.


texts: How to create a convex hull in R based on the larger of two shapefiles' extents?

texts:
In R, I have two shapefiles: Shapefile A represents roads (polylines), Shapefile B some location (points). I want to plot the convex hull enclosing the study region, and it has to be set to the larger of the extents of the two shapefiles.

To produce the convex hull, I use the gConvexHull function (out of the rgeos package) within a function I have written, which preliminary checks which of the two extents is larger using a simple if/else evaluation:

if(extent(points) > extent(polylines)){
    region <- gConvexHull(points)
  } else {
    region <- gConvexHull(polylines)
  }

It seems that the extent of the polyline shapefile is actually larger:

extent(points) > extent(polylines)
[1] FALSE

The details about the two extent are as follows:

> extent(points)
class       : Extent
xmin        : 443314
xmax        : 459959.1
ymin        : 3963496
ymax        : 3976765
> extent(polylines)
class       : Extent
xmin        : 439326.4
xmax        : 458996.4
ymin        : 3963185
ymax        : 3983645

This should imply (at the best of my understanding) that the points should all fall within the polylines' convex hull. Yet, I cannot understand why some points fall well outside the convex hull based on the polyine extent (see image). With teference to the image attached, I am quite happy with the convex hull, but I would like it to be larger toward south-est, in order to include the few points left outside.


texts:
need a work around to produce a kernel density map of polygons (national parks system) layer at 30m grid cell and 500m bandwidth.  the kernel density tool in ArcGIS 10 does not work with polygons.

at this point i am thinking convert polygons to raster and use point estimate or focal statistics tool perhaps to extract the raster values (1 = park, 0 = no park).


texts: PostGIS: split a polygon in a given ratio

texts: Is there a convenient way to split a polygon into n parts, more-or-less equal in size in PostGIS?


texts:
I have raster data representing urbanized areas, which I'd like to trace and convert to a polygon.

Using  ArcMap's Raster to Polygon tool, I'm able to get something close to that.

Unsimplified:

Simplified:

However, you can see that there are many diagonal lines (roads) which create chains of polygons that share a corner.

This ups my polygon count significantly - these raster datasets are being processed at the state level. Is there an Arc or GeoTools tool to smooth out these lines and create fewer polygons? It's okay if the result loses some precision. In the end, I'm looking for something similar to what I get with the simplified polygon, just with adjacent polygons joined.


texts: Calculating adjacent temporal days (ATD) by iteration using Google Earth Engine

texts:
I need to make a classification to eliminate the snow cover, for this we are following the ATD method of Gafurov, in which we observe 1 day before and 2 days after on a given pixel or vice versa, in this way, check if it corresponds to land or snow (eg: if the cloudy pixel has two previous days with clouds, it will be assumed that it is snow).
I have thought the steps but I don't know how, my idea is:
This is my code
var ROI = ee.Geometry.Rectangle([-71.633, -32.229,
                                 -69.943, -33.200]);

//Map.addLayer(ROI);
Map.centerObject(aconcagua,9);

//Importar coleccion de imagenes MODIS 10A1006 c6-TERRA
var colMODIS = ee.ImageCollection("MODIS/006/MOD10A1")
                 .select('Snow_Albedo_Daily_Tile_Class'); //Banda de nubosidad

// Define time range
var startyear = 2000;
var endyear = 2020;

var startmonth = 1;
var endmonth = 12

///    **¿how to calculate monthly average?**     ////

//Establecer la fecha en formato de fecha ee
var startdate = ee.Date.fromYMD(startyear,startmonth,1);
var enddate = ee.Date.fromYMD(endyear,endmonth,31);

//Función para reclasificar los valores de nubosidad (MOD10A1)
var CloudMask = function(image){
  var mask = image.eq(150).multiply(100);
  return mask.set('system:time_start', image.get('system:time_start'));
};

var cloudCollection = colMODIS.map(CloudMask);
//print('cc', cloudCollection);

**How do I add the iteration to the masked clouds or pixel I need to determine?**
///iterando sobre un mismo dia///////

var aDate = ee.Date.fromYMD(2015,12,21);
var days = ee.List.sequence(-1, +2);
var dates = days.map(function(d) {
  return aDate.advance(d, 'day');
});

var iteracion = cloudCollection.map(CloudMask);
//print('cc', cloudCollection);

//Muestra la primera imagen de la colección
print(colMODIS.first());
print(dates);


texts: Adding message error box when parameters do not satisfy some conditions

texts:
I have 3 parameters in my tool, including para0, para1, para2. These parameters will be the user's inputs. I would like to display a message box if para0>para1 or para1>para2 or para2>para3.
My script in Tool Validation shows the message box every time when one parameter is filled. However, I would like the message box should appear only once when all parameters has been filled.
import arcpy, pythonaddins
class ToolValidator(object):

 def updateParameters(self):
   if (self.params[0].value is not None) and (self.params[1].value is not None) and (self.params[1].value<self.params[0].value):
       pythonaddins.MessageBox('WARNING: Degree 2 must be larger than degree 1', 'WARNING',0)
   elif  self.params[1].value is not None and self.params[2].value is None:
        pass
   elif self.params[1].value is not None and self.params[2].value is not None and self.params[2].value<self.params[1].value:
        pythonaddins.MessageBox('WARNING: Degree 3 must be larger than degree 2', 'WARNING',0)
   elif  self.params[2].value is not None and self.params[3].value is None:
         pass
   elif self.params[2].value is not None and self.params[3].value is not None and self.params[3].value<self.params[2].value:
         pythonaddins.MessageBox('WARNING: Degree 4 must be larger than degree 3', 'WARNING',0)


texts: How do I find vector line bearing in QGIS or GRASS?

texts:
How can one extract the bearings from a set of lines in a vector file?

I'm trying to find the bearings of several straight vector line segments (simplified contour lines, actually) and can't figure out how to do it. The QGIS measure tool can tell me individual line bearing if I use a N/S grid overlay to provide a 0º reference, but my mouse precision is probably questionable, and doing that for every line in our sample is going to take longer than I can devote to this project.

Even if there is just a way to automatically pair line end-point nodes, get the XY data, and then let excel calculate the bearings for me, I would love to know.

I really like using QGIS, but am also OK with GRASS (though shaky on text interface), SAGA, and ArcGIS (but only if I really have no other choice), so if any of the programs have a clever way to do this, let me know.

-Nick


texts: Interpretation of ArcGIS Kernel Density legend parameters

texts: In ArcMap 9.3 I've used Kernel Density to map various incidents, but the resulting shapefile doesn't display any units of measurement. Is there a good, not-to-technical source that would explain in lay terminology the interpretation of the output values in terms of the input cell size and search radius?


texts: eVis-Plugin centers mapwindow on coordinate origin

texts:
I have a QGIS-project with layers loaded from a postgis-database and also some shapefiles. I use the eVis-Plugin to display pictures.
The displaying is working fine but after clicking on the geometry to open the eVis-Browser the mapwindow section always jumps to  the origin of the coordinatesystem (0/0). Also the asterisk from eVis showing which geometry is selected is located at (0/0)-but I don't have any geometries located there. Because of that I always have to zoom back to the map section with the geometries. How can I avoid this change of the mapwindow section?

I have this problem no matter if the path of the photo comes from a shapefile-layer or from the database.
The QGIS-project is defined with the coordinatesystem EPGS:21781 (CH1903, Switzerland). Because of that the geometries have coordinates like 600'000/200'000.


texts: Locating records not in selection using ArcPy?

texts:
I have a list of addresses that I need to contact. Some are listed in the attribute table, and some aren't. I'm trying to find the ones that aren't.

The list:

contacted = ['123 STOWE ST', '123 ROSE DR', '124 ROSE DR', '125 ROSE DR', etc.]

The attribute table has a Property_Street field that lists addresses. I want to figure out which addresses are in the contacted list and are not in the Property_Street field.

The only thing I've figured out so far is to isolate the records that have been confirmed as contacted based on the 'Contacted' field in the attribute table. But it returns a layer, not a field, and I don't know how to isolate the Property_Street field from that layer.

query = "\"CONTACTED\" = 1"
contacted_in_tbl = arcpy.SelectLayerByAttribute_management("hot_zone", "NEW_SELECTION", query)


texts: If/then VBScript/Python code equivalent to SQL IN ('x','y',z') expression in ArcGIS Field Calculator?

texts:
we need just like the following, only with multiple records selected... have tried the "xyz" in (1,2,3,4,5) SQL code but of course VB Script wants something else.

dim f2
if [field1] = "foo" then
  f2 = "bar"
end if

Screen shot of this being used in the field calculator.


texts:
So I developed a script that traverses through a root directory, and any subdirectories and catalogs layers files. Then exports these layer files' FGDC metadata and outputs them to a folder. The code at this point is hit/miss sometimes completes and sometimes processes "most" of the input and errors out close to being done.

Can anyone point out what's going on here? Error code is:

  File "C:\Program Files
  (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\conversion.py", line 624, in
  ExportMetadata raise e

  ExecuteError: ERROR 000582: Error occurred during execution.

import arcpy,os
arcpy.env.overwriteOutput=True
metadataout=r'C:\tmp\out'
for dirpath,dirnames,filenames in arcpy.da.Walk(r'C:\folder\files',datatype="Layer"):
    for filename in filenames:
        print filename
        translator = r'C:\Program Files (x86)\ArcGIS\Desktop10.2\Metadata\Translator\ARCGIS2FGDC.xml'
        arcpy.ExportMetadata_conversion(os.path.join(dirpath,filename),translator,os.path.join(metadataout,str(filename).split(".")[0]+'.xml'))