samedi 31 janvier 2015

Four parameter Helmert transformation using four points


I'm looking for an algorithm to calculate a Helmert transformation using four reference points. Plus, does anyone know how I can calculate the error once I've completed the transformation?





Script and model crashes after first iteration


I have a python script which dies after the first iteration. It dies on the second feature class to coverage. This also happened in modelbuilder, which is why I went to python hoping it would go away. I can create the coverage on the layer that crashes the script in the standalone tool, but once in the script, after the first iteration, it dies. It makes me think that there is something being held on to in memory by the script or modelbuilder that I am not aware of.


I have tried repairing geometry of the input dataset; ensuring it is singlepart; name chages. None has worked.


View image for error in image. It says invalid topology, but it works fine standalone.


enter image description here



import arcinfo, arcpy, os, sys
from arcpy import env
print 'Starting....'
env.OverWriteOutput = True
arcpy.SetProduct("ArcInfo")
import datetime
import time
ts = time.time()
st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
print st

tbx = arcpy.ImportToolbox(r"C:\Program Files (x86)\ArcGIS\Desktop10.1\ArcToolbox\Toolboxes\Coverage Tools.tbx", "COVG")
SDE = "C:\\Users\\david\\AppData\\Roaming\\ESRI\\Desktop10.1\\ArcCatalog\\p747.sde"
AVI = r"C:\david\delete\AVI.shp"
#AVI = "G:\\ALPAC\\Projects\\P747\\3_Landbase\\Processing\\AVI\\AVI_20141216_Only_polynum.shp"
FMUs = r"C:\david\delete\fmus2.shp"
#FMUs = r"\\silver\\clients\Projects\P747\3_Landbase\LB1\FileGeodatabase\All_Data\All_Data.gdb\ALPAC_Data\Administrative_FMUs"
GDB1 = "\\\\silver\\clients\\Projects\\P747\\3_Landbase\\LB1\\Temp\\"
FCView = "\\\\silver\\clients\\Psrojects\\P747\\3_Landbase\\LB1\\TEMP\\FCView.lyr"
LayerU = r"G:\Projects\P747\3_Landbase\LB1\Multiunion\TEMP\Union_Fwrd"
OutLOC = "\\\\silver\\clients\\Projects\\P747\\3_Landbase\\LB1\\multiunion\\m_20150129\\"
TableView = "\\\\silver\\client\\Projects\\P747\\3_Landbase\\LB1\\Temp\\Tableview.lyr"

FieldMappings = arcpy.FieldMappings()
FieldMap1 = arcpy.FieldMap()
#arcpy.RepairGeometry_management(FMUs)
if arcpy.Exists(FCView):
arcpy.Delete_management(FCView)

arcpy.MakeFeatureLayer_management(FMUs, FCView)

FieldMap1.addInputField(FMUs, 'FMU_NAME')
FieldMappings.addFieldMap(FieldMap1)

r = 1
for row in arcpy.SearchCursor(FCView):

objectid = str(row.getValue("FMU_NAME"))
#print '"FMU_NAME"= {}'.format(objectid)
print 'Working on ' + objectid

FMUNAME = GDB1 + "FMU_" + objectid + ".shp"
AVINAME = GDB1 + "AVI_" + objectid + ".shp"
OUTCOV = OutLOC+ "MU_" + objectid
OUTCOVPOLY = OutLOC+ "MU_" + objectid + " POLYGON"

if arcpy.Exists(FMUNAME):
arcpy.Delete_management(FMUNAME)
if arcpy.Exists(AVINAME):
arcpy.Delete_management(AVINAME)
if arcpy.Exists(OUTCOV):
arcpy.Delete_management(OUTCOV)
if arcpy.Exists(GDB1+ "MUa_" + objectid):
arcpy.Delete_management(GDB1+ "MUa_" + objectid)
if arcpy.Exists(GDB1+ "FMU_" + objectid):
arcpy.Delete_management(GDB1+ "FMU_" + objectid)
if arcpy.Exists(TableView):
arcpy.Delete_management(TableView)
if arcpy.Exists(GDB1 + "AVICV_" + objectid):
arcpy.Delete_management(GDB1 + "AVICV_" + objectid)
if arcpy.Exists(GDB1 + "AVIa_" + objectid + ".shp"):
arcpy.Delete_management(GDB1 + "AVIa_" + objectid + ".shp")

arcpy.SelectLayerByAttribute_management(FCView, "NEW_SELECTION", '"FMU_NAME"=' + "'" + objectid + "'")

print 'Creating FMU shape and coverage for clipping'

arcpy.FeatureClassToFeatureClass_conversion(FCView , GDB1, "FMU_" + objectid, "#", FieldMappings)
arcpy.FeatureclassToCoverage_conversion(FMUNAME + " POLYGON", GDB1 + "FMU_" + objectid, "", "DOUBLE")

print 'Running clips'

arcpy.Clip_COVG(LayerU, GDB1 + "FMU_" + objectid, GDB1+ "MUa_" + objectid)
arcpy.Clip_analysis(AVI, FMUNAME, GDB1 + "AVI_" + objectid)

#print 'Repairing geometry'

#arcpy.RepairGeometry_management(GDB1 + "AVI_" + objectid + ".shp")

print 'Turn AVI into coverage'

#ERROR OCCURS HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

arcpy.FeatureclassToCoverage_conversion(AVINAME + " POLYGON", GDB1 + "AVICV_" + objectid, "", "DOUBLE")

print 'Unioning the ' + objectid + " datasets"

arcpy.Union_COVG(GDB1 + "AVICV_" + objectid, GDB1+ "MUa_" + objectid, OutLOC + "MU_" + objectid)

#print 'Running multi-part to single-part'

#arcpy.MultipartToSinglepart_management(GDB1 + "AVIa_" + objectid + ".shp", GDB1 + "AVI_" + objectid)

print 'Calculating fields'

arcpy.MakeTableView_management(OUTCOV +'\\polygon', TableView)
arcpy.AddField_management(TableView, "MKey", "LONG", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")
arcpy.CalculateField_management(TableView, "MKey", "( " + str(r) + " * 1000000 ) + !FID!", "PYTHON", "")
arcpy.AddField_management(TableView, "AreaHA", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")
arcpy.CalculateField_management(TableView, "AreaHA", "!shape.area@hectares!", "PYTHON", "")

print 'Deleting fields'

arcpy.DeleteField_management(TableView, "U20#;U20-ID;U19#;U19-ID;U18#;U18-ID)

#print 'Deleting fields'
#if arcpy.Exists(SDE + objectid + "_tables_v2"):
# arcpy.Delete_management(SDE + objectid + "_tables_v2")

#print 'Table to table'
#arcpy.TableToTable_conversion(TableView, SDE2, objectid + "_tables_v2")

#print 'Deleting fields'
#arcpy.DeleteField_management(TableView, "FEATURE_TY;NAME;TS_BUFF;PLOT_TYPE;DISP_NUM;DISP_TYPE;LANDBASE;RIVBRK;FMU_NAME;MOSA;SLOPE;FIRE_NUMBE;BURNCODE;BURN_CLASS;YEAR;RFMA_NAME;HYD_FEAT;CRPRO_NAME;TYPE;PPA_STAT;DIDS_NUM;DIDS_TYPE;ID;WTRSHED;FN_TYPE;FN_NAME;MUNIC_TYPE;MUNIC_NAME;FMA_STATUS;FEATURE_NA;DFA_STATUS;HY_DIST;HY_SRCE;HY_FEATURE;POLYGON;OWNER_1;STATUS;OWNERSHIP;CATEGORY;OPEN_NUM;COWPER_LOS;RSIID;POLY_NUM")

ts = time.time()
st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
print st

print 'Next....'

r += 1


python 2.7, Arcinfo license and 10.2 Arc





How Do I Add Nodes to Linestrings at the Overlapping Points with a Polygon Layer in Spatialite?


I have two Spatialite layers, a LINESTRING and a POLYGON layer. How do I add nodes to the LINESTRINGS at any point that intersects the POLYGONS? (Preferably using SQL queries only. Temp tables are fine)





How to extract information from several shapefiles in the same time?


I have a shapefile for 10 catchments and other three shapefiles for landuse, soil type and rock types. To extract the area of land use types, soil types or rock types for each catchment, I used Tabulate intersection.


However, Tabulate Intersection helps me to extract information from one shapefile only at a time (e.g. either soil type or land use type). I want to extract information from the three shapefiles in the same time.


I want to get the area of combination of land use, soil type and rock type in the same time. The output I’d like to get should look like the table below enter image description here


Any idea how can I do this in ArcMap would be appreciated?





Calculating Slope, Flow Accumulation and Topographic Wetness Index (TWI) using ArcGIS for Desktop? [duplicate]



I am working on a project that requires me to extract values from rasters (viz the slope and TWI) for a set of point dataset that I have. I tried calculating the Slope, Flow accumulation and the TWI from the DEM (using ArcGIS 10.1) but somehow the slope and the TWI raster outputs seems erroneous!


For slope, I get values ranging from 0 to 89 (file attached here) and for TWI, I get values between 19.58 and 9.40 (file attached), with no data data for most of the area! However, while extracting values for both slope and TWI to my point shape file, I mostly get 0 as the RASTERVALUE for most of the point data.


Could anyone kindly review where exactly I am going wrong and how do I correctly get the slope and the TWI?


enter image description here





Merge based on joined attribute in QGIS


I have a single layer of polygons (drawn around every zip code). I have a CSV file with territory numbers and the zip codes in each territory. I joined these and was able to color each territory (multiple zip codes) instead of each individual zipcode. What I'd like to do now is get rid of the zip code boundaries to only have the territory boundaries, but I can't figure out how to do this.





Getting number as parameter to use in SQL expression leads to ExecuteError: ERROR 000358?


In my script I am using the Select tool (arcpy.Select_analysis) and in the SQL expression, I want to use a number that I call in as a parameter. I have trying to script it like:



subsize = arcpy.GetParameter(3)

where_clause = '\"AreaSqKm\" > {0}'.format(subsize)

arcpy.Select_analysis(waterbodies, lg_waterbodies, where_clause)


In this example I'm entering the parameter as the number 0.0005, as a double.


I've tried tweaking it various ways, but every time I try to run the tool I get: ExecuteError: ERROR 000358" Invalid expression "AreaSqKm > 0.0005 Failed to execute (Select).


If i hard code that variable in a script as 0.0005 and run it as a stand alone it works fine. Any ideas on why it won't run in arc?





how to extract country border from openstreetmap


enter image description here


I'm trying to extract the Jordanian country border from an openstreetmap. When I click the download link for the file, the following page opens:


enter image description here


My question is: How do I save these XML tags as an XML- or OSM file which I can convert into a shape file, so that I can use it in QGIS?





Many pipelines and buffers need to display one at the time,


I have more than 1000 individual pipeline in one shapefile with 4 different buffer size. I wish to show one pipeline at a time with its corresponding buffers. I tried to query out every single line but it is way to long and painful process with over 1000 lines. I was thinking to split them and calculate the buffers for each line but again, I won't finish until Christmas.


Any idea?


Thank you very much to anybody who is answering my question.


Sincerely, Vanda





How to convert between SWEREF99 TM (GRS80) and long-lat (WGS84) coordinate with JMapProjLib (Java version of Proj4)?


I'm making an android app which is reading SWEREF99 TM (GRS80) coordinates from a file, but I need to convert them to long-lat (WGS84) coordinates, and also in the oposite direction (WGS84 -> GRS80). For that I'm using JMapProjLib, which is a "Java porting" of the C library Proj4. I'm having problems with converting between the both. Here is the code I use (Placed in SWEREF99TMConverter class):



/**
* Convert a long-lat coordinate to a SWEREF99 TM coordinate.
*
* @param longLatCoordinate The long-lat coordinate to convert.
*
* @return The converted SWEREF99 TM coordinate.
*/
public static Coordinate longLatToSWEREF99TM(Coordinate longLatCoordinate) {
// Create a new SWEREF99 TM projection
Projection projection = ProjectionFactory.fromPROJ4Specification(new String[] {
"+proj=utm",
"+zone=33",
"+ellps=GRS80",
"+towgs84=0,0,0,0,0,0,0",
"+units=m",
"+no_defs"
});

// Convert the long-lat coordinate to a Point2D.Double
Point2D.Double coordinate = new Point2D.Double(longLatCoordinate.x, longLatCoordinate.y);
// Get the location as a SWEREF99 TM Point2D.Double
Point2D.Double sweref99TMPoint = projection.transform(coordinate, new Point2D.Double());

// Convert the Point2D.Double to a Coordinate and return it
return new Coordinate(sweref99TMPoint.getX(), sweref99TMPoint.getY());
}

/**
* Convert a SWEREF99 TM coordinate to a long-lat coordinate.
*
* @param sweref99TMCoordinate The SWEREF99 TM coordinate to convert.
*
* @return The converted long-lat coordinate.
*/
public static Coordinate sweref99TMToLongLat(Coordinate sweref99TMCoordinate) {
// Create a new WGS84 Projection
Projection projection = ProjectionFactory.fromPROJ4Specification(new String[] {
"+proj=longlat",
"+ellps=WGS84",
"+nodefs"
});

// Convert the SWEREF99 TM coordinate to a Point2D.Double
Point2D.Double coordinate = new Point2D.Double(sweref99TMCoordinate.x, sweref99TMCoordinate.y);
// Get the location as a long-lat Point2D.Double
Point2D.Double longLatPoint = projection.transform(coordinate, new Point2D.Double());

// Convert the Point2D.Double to a Coordinate and return it
return new Coordinate(longLatPoint.getX(), longLatPoint.getY());
}


I found another question about converting long-lat (WGS84) coordinates to SWEREF99 TM (GRS80) coordinates here, but it doesn't really work for me...


When calling this:



Coordinate coordinate1 = SWEREF99TMConverter.sweref99TMToLongLat(new Coordinate(546280.89, 6477506.89));
System.out.println("X: " + coordinate1.x + ", Y: " + coordinate1.y);

Coordinate coordinate2 = SWEREF99TMConverter.longLatToSWEREF99TM(new Coordinate(coordinate1.x, coordinate1.y));
System.out.println("X: " + coordinate2.x + ", Y: " + coordinate2.y);


I get the following output:



X: 546280.89, Y: 6477506.89
X: 3499505.029714266, Y: 1.6513960574356137E7


But it should give me the following output:



X: 15.79263771, Y: 58.43582986
X: 546280.89, Y: 6477506.89


(I checked the "correct" output for the same coordinates that I inputed in the methods on epsg.io)


Because there isn't any good documentation for JMapProjLib, it makes it even harder to figure everything out. If anyone who knows something about this would like to explain what I am doing wrong, I would be more than pleased!





What is the best way to view LAS data using free open source software?


Is there a pipeline for viewing, classifying, and processing LAS data using free open source software?





POSTGIS get the max length of the polygon and the average width


I have in postgis a polygon type table.


I need to calculate automatically the maximum length of the polygon:


enter image description here


And the second one is the average width:


enter image description here


I am doubting rigth now if this is possible as although all my polygons will be nearly rectangular in other cases it can be really ambiguous and it is nearly imposible to distinguish between width and height.


Let's see if someone can shed light on this.


Regards,





How to resample a DEM from GCS to UTM with respect to reprojection bounds parameter?


When reprojecting a DEM (e.g., SRTM-derived 1-arc DEM) using PCI Geomatica for example, to constrain pixel size and maintain a square pixel you can either change the image extent or the number of pixels, or both. What are the implications of changing either parameters with respect to preserving the DEM accuracy? Thanks.





ArcGIS Custom data setup functionality through ArcPy


Is it possible to script the "Custom Data Setup" functionality in ArcGIS using ArcPy? I have a need to automate a lot of such custom data setup tasks and a scripting provision will make my life much simpler.





Download offline satelite to be used for python app [on hold]


I need to download a high resolution map close as i can get that is publicly available as a satellite image to be used offline from the internet about to be used in my python app.


This map will be then used as a GUI python app to as accurately plot my current coordinates of a robot given to me by our other modules, waypoint lines, heading, and end point


Currently just using a image from google maps and using pygame to place points, but its hard to accurately plot points of real coordinates of latitude and longitude.





In Mapbox Studio how do I make an image for a marker be 400 pixels without getting clipped off?


For Mapbox Studio, I've prepared this Squid drawing I'm going to put in a body of water, similar to the ships in the 'Pirates Return' map.


I have sizes of the drawing in 100,200, and 400 pixels. However, the 400 pixel drawing gets cut off. The last time I had this problem it was in the buffer settings. However, my buffer-size is now at the max. So for an image applied to a marker, how do I make it overlap adjacent tiles?


Picture attached for clarification. squid





python code doesn't preserve original range of values from my raster colormap template


I'm working towards an animation or movie of some distributed model output so I need to use a batch process for several hundred rasters that applies a consistent colormap and value range, however the code imports the colormap template but NOT the original range of the template. I can preserve the range if I go file by file and click properties, symbology, click on the import button with the picture of the open folder next to the save button, and import the template layer. What can I do to the code to preserve range and make it a batch process?? Also, it looks like I'll need to batch save my jpgs as .lyr files, but one step at a time. Thanks!



# Import system modules
import arcpy
from arcpy import env

# Set the current workspace
env.workspace = r"C:\VMshared\small_example_valley2"

# Set layer to apply symbology to
inputLayer = "snowdepthN0001.tif.jpg.lyr"

# Set layer that output symbology will be based on
symbologyLayer = r"C:\VMshared\small_example_valley2\snowdepthcolor3\snowdepthCOLOR.tif.lyr"

# Apply the symbology from the symbology layer to the input layer
arcpy.ApplySymbologyFromLayer_management (inputLayer, symbologyLayer)


**edit --- The code below gives me a whole bunch of errors. Any ideas? Do I need mean and std dev if I just want to set max and min?



# Import system modules

import arcpy

from arcpy import env
arcpy.env.overwriteOutput = True

# Set the current workspace
env.workspace = r"C:\Users\afullhar\Documents\ArcGIS"

# Set layer that output symbology will be based on
symbologyLayer = r"C:\VMshared\small_example_valley2\snowdepthcolor3\snowdepthCOLOR.tif.lyr"

for lyr in arcpy.mapping.ListLayers(r"C:\Users\afullhar\Documents\ArcGIS"):

arcpy.ApplySymbologyFromLayer_management(lyr,symbologyLayer)
arcpy.SetRasterProperties_management(lyr,"ELEVATION","1 3437 5033 4236 462","#","#")




Export from QGIS to Google Maps maintaining formatting


I'm totally new to QGIS so I'm not even sure this is possible.


I've created a bunch of polygons within QGIS and they look just like I want them (color, transparency, etc.).


What I'd like to do now is to export this somehow so that this same formatting is visible in a Google Map I'm creating as a layer. Is this possible? What format do I export?


I've tried exporting as geoJSON, but what appeared in Google Maps was not formatted. The boundaries of the polygons were there, but no colors, etc.





is it possible to calculate one spatial difference (deviation) from Δx, Δy, Δz (wgs84) of coordinates?


Comparison of two gps receivers or methods(difference between reference and acquired coordinates of points) could be better expressed by one number. Is there an official formula?





Merge zip code based polygons to create sales territories


I have access the full data set of the KML file shown here: http://ift.tt/1Lw5w58


Here's what it basically looks like: http://ift.tt/15VqZnu


It's basically a bunch of polygons that match (close enough) ZIP code boundaries. What I also have is a table that shows which zip codes go with which territory (i.e., a territory overlaps multiple ZIP codes).


I'm looking for a tool that I can use to merge these two sources together to create new polygons consisting of the group of zip code polygons that make up a territory.


Mapping is completely new to me, so I'm not even sure which tools I need to use. Any direction would be appreciated.


PS: I should add that ideally I'd like to avoid making a big software purchase.





Is there a QGIS equivalent to ArcGIS's Make OD Cost Matrix Layer (Network Analyst)? [duplicate]



This question already has an answer here:




I'm looking to create a OD cost distance matrix for a network data set I have created. Is there a way of doing this in QGIS which is akin to Make OD Cost Matrix Layer within ArcGIS's Network Analyst.


My question is similar to this but there was no satisfactory answer given then. That question was asked nearly months ago and am wondering if there is a potential solution.





How to map data from USGS NAS database, using HUC?


I am querying the USGS NAS (Nonindigenous Aquatic Species) database. The collection data for the results that are returned don't include lat/long points, but have an HUC (Hydrologic Unit Code). I have no idea where to start in terms of mapping this information with HUCs. I've done some searching, but to no avail. I'm wondering if someone could give me a nudge in the right direction or offer any advice? Here is the query I'm working with right now: http://ift.tt/1Kgoh9l


I'd really appreciate any help. Thanks for looking!





Leaflet and CartoDB - three questions


When I add a leaflet layer control, even just for the basemaps, I cannot see the cartodb viz.json, though the hover text and legend show up and no errors show up in the console.


If the leaflet layer control does not work with cartodb.js, what other basic leaflet functions do not work?


If the layer control does work, how do I create a leaflet layer that can be toggled in the layer control from a cartodb viz.json? I have read that the cartodb.createlayer does not create a leaflet layer. It seems you can add the cartodb table, but of course that takes away the whole point of using cartodb for easy visualization. This seems like a basic function, I am a novice in terms of coding so maybe I am missing something.





errors after installing 64 bit background geoprocessing on ArcGIS desktop 10.2.2


I installed 64 bit background geoprocessing on my ArcGIS 10.2.2 and then changed my pythonpath to "C:\Python27\ArcGISx6410.2" so that my code can benefit from the 64bit. then I had to install a 64b Scipy, this lead into an error as follows:



RuntimeError: module compiled against API version 9 but this version of numpy is 7
Traceback (most recent call last):

File "C:\Users\Ehsan.abdolmajidi\workspace\ArcPy_matching\NVDB_Matching_v18_H_4\Runner_v18_H.py", line 6, in <module>
from roundabout import *
File "C:\Users\Ehsan.abdolmajidi\workspace\ArcPy_matching\NVDB_Matching_v18_H_4\roundabout.py", line 8, in <module>
from scipy import spatial
File "C:\Python27\ArcGISx6410.2\Lib\site-packages\scipy\spatial\__init__.py", line 89, in <module>
from .kdtree import *
File "C:\Python27\ArcGISx6410.2\Lib\site-packages\scipy\spatial\kdtree.py", line 8, in <module>
import scipy.sparse
File "C:\Python27\ArcGISx6410.2\Lib\site-packages\scipy\sparse\__init__.py", line 206, in <module>
from .csr import *
File "C:\Python27\ArcGISx6410.2\Lib\site-packages\scipy\sparse\csr.py", line 13, in <module>
from ._sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
ImportError: numpy.core.multiarray failed to import"


now I am trying to install a new 64 numpy but I can't find a .exe file. .whl file needs pip which when I try to install return new error: "no module named _socket "


do you know if I can find a version 9 of 64 bit Numpy which is .exe? or do you know how I can fix the first problem?


Answer: I solved the problem by updating the numpy. the problem was that I installed the SciPy which was not compatible with the numpy embedded in the 64 background geoprocessing.





QGIS Semi-automatic classification plugin install error on OS X 10.10: matplotlib.backends.backend_qt4agg


I have tried repeatedly to install the QGIS Semi-automatic classification plugin via both (1) Plugins > Install & Manage Plugins and (2) manually based on other comments I found here, but I can't get it to work. I continue to get the error:


The plugin is broken. Python said: No module named matplotlib.backends.backend_qt4agg


I have checked and have installed matplotlib, GDAL, scipy, numpy via macports (QGIS was installed via macports as well, but I have uninstalled, reinstalled, and rebooted a couple of times at this point). I am not sure how else to proceed. Any hints would be greatly appreciated. Thanks in advance!





How to get Geography data to GeoJson in PostgreSQL?


I am using PostgreSQL database and there is a field in a table(area) i.e. geog pulic.geography(Points,4326). It contains below type of records


"0101000020E6100000BA83D89942334540780B24287ED051C0"


I am using ST_AsGeoJson(), to get the GeoJson through above types of records.


My database is connected and I am using a query to fetch result i.e.


$query="SELECT ST_AsGeoJSON(geog) FROM area";


But I am getting below warning and not getting any results


"Warning: pg_query(): Query failed: ERROR: function st_asgeojson(public.geography) does not exist LINE 1: SELECT ST_AsGeoJSON(geog) FROM public.area ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. in /home/domain/public_html/sg_database.php on line 20"


Please suggest regarding this..


Thanks





Check Geometry Type of a Shapefile Using GeoTools?


I want to get the type (point, line, or polygon) of shapefile using GeoTools but so far I haven't found any code. Any other Java library also works for me.


Thanks.





How to create a custom input text in a CartoDB


What is the best way to modify the searbox listener searchbox in the CartoDB map?


I would like to disable the default event listener for the CartoDB searchbox and first to execute my own listener and then decide If I want to execute the default CartoDB event (geolocation) for the searchbox. How is the best way to do it?


Thanks!





Why my Shapefile is not loaded into OpenLayers?


This is my website for test: http://ift.tt/1A5QrDX


I want to put my Shapefile in OpenLayers. I found an example at http://ift.tt/1zlqtt3


I tried it and put my Shapefile in OpenLayers using proj4 to convert EPSG:3826 (my Shapefile's projection is EPSG:3826) to EPSG:4326.


But, I can't see my Shapefile on the OpenLayers map. What's wrong?





Loading Multiple CSV Files into PostgreSQL Table


I am having multiple CSV files. Those CSV files are the log files created as a result of running a windows batch file. The location of these CSV files lies on the server and i want all these CSV files to copy from the server to a particular table (say import_error_table, which i had already created in postgreSQL).How to accomplish this using postgreSQL? Help would be appreciated.





ERROR: attempt to redefine parameter "postgis.backend"


I just install "SFCGAL". When I use "ST_3DIntersection", It get below error:


ERROR: attempt to redefine parameter "postgis.backend" SQL state: XX000


How can I fix?


I already saw http://ift.tt/1tJOmLx, But I do not know how should I do.





vendredi 30 janvier 2015

Coloring polylinestringzm M values in QGIS


I have output from a geophysical technique that produces X,Y,Z and scalar value for millions of points, which have been stitched together appropriately (by networkx if it matters) into polylinestringzm format and inserted into PostGIS by my own (homebrewed) geophysical code. There is one polylinestring per Z value (roughly 10-20% of the ~12 million points all share the same Z values), and each of the 10 or so Z values and their corresponding polylinestringzm geometries are in a separate row of the table.


What I'd like to be able to do is color each point in a polylinestring according to its M value, but have been struggling for quite some time in how to accomplish this. (Even better would be to have a color gradient on the line segment between two points.)


I really need to have this work in QGIS (or ARCscene?) because there is a whole lot of other normal 2D GIS info to integrate. My earlier trials outputting my data in VTK format and using VisIt from LLNL to read both the VTK and GIS files, while successful, is too heavyweight to share with my colleagues in joint projects.


Any hints on how to color-by-m-value would be greatly appreciated!


TIA, Frank Horowitz





How to add lables/etc with eia shapefiles in R?


I'm trying to create a map of US Shale basins and I'm very new to creating maps. I have downloaded the shapefiles form the eia. I have also, been able to created a basic map with the bases plotted (please see code below). I would like to add lables/etc to this map. I believe these would be in the other files downloaded outside the shp file.



library(maps)
map("state")
shapLocation<- "C:/shapfile/shalegasbasin/"
pcontorta <- readShapePoly(paste(shapLocation,"US_ShaleBasins_EIA_May2011.shp",sep=""))
plot(pcontorta, add=TRUE, col=adjustcolor("black", alpha.f = 0.6), border=FALSE)


shapefile from: http://ift.tt/1yMpy16


Description of a shapefile: http://ift.tt/ThUnJF





How to Convert ISelectionSet to ITable


I Have code



ISelectionSet pSelectionSet;
layer = AxMapControl1.get_Layer(0);
pFeatSel = (IFeatureSelection)layer
pSelectionSet = pFeatSel.SelectionSet;
ITable table = pSelectionSet as ITable;


How to convert selection to a table?





POSTGIS get the max length of the polygon and the average width


I have in postgis a polygon type table.


I need to calculate automatically the maximum length of the polygon:


enter image description here


And the second one is the average width:


enter image description here


I am doubting rigth now if this is possible as although all my polygons will be nearly rectangular in other cases it can be really ambiguous and it is nearly imposible to distinguish between width and height.


Let's see if someone can shed light on this.


Regards,





Is it possible to calculate area of polygons from GPS points without POSTGIS


I am new with GIS.


Assume we use the UTM30N coordinate system.


Is it possible to calculate an area (say a square box) by the 4 given points? (assume the points are in order, and the coordinates are very close to each other.)


Corollary, is it possible to calculate the area of a polygon?


Can this be done without the use of PostGIS?





Text Orientation


I rotated my extent -45 degree to make it look better. Problem is all the labels that I converted to graphics so I could rearrange them are also at -45 degrees. Any way to change that easily?


enter image description here





BC Albers X Y to Google Map Long Lat


I have a big table (with more than 1000 rows) which contains point data with BC Albers X and Y values. I need to display this data on Google Maps but I have not my PC Laptop with me now to have access my GIS tools.Can you please let me know how I can do this through Ms Excel formulas calculation?


Thanks a lot





Problem loading tif into raster dataset in ArcSDE 10.2


I have over 1000 raster datasets I need to mosaic into ArcSDE 10.2. I can't use a mosaic dataset because the county I am working for wants to keep the files on an external HD, so the pointers won't work. Unfortunately, I ran into this 10.2 bug when defining a spatial reference for the parent raster dataset:


http://ift.tt/1CHXPER


The problem is that when I try the suggested workaround and create a raster dataset without a defined spatial reference, loading data is MUCH slower, meaning it will take weeks or possibly months to load everything. I am building pyramids with Bilinear sampling, and LZ77 compression. Any suggestions as to how I can speed up this process?





Does " ST_Intersect" work in 3d truly?


I am using "ST_INtersection" between two 3D line which are not in a height and I think they should not intersect together, but the result give their intersection.


SELECT ST_ASText(ST_Intersection( ST_GeomFromText('LINESTRING( 1 1 1, 5 5 1)'), ST_GeomFromText('LINESTRING( 4 1 10, 1 5 10)'


)));


result:


"POINT Z (2.71428571428571 2.71428571428571 5.5)"





QGIS on UHD screen


I've got a new laptop that came with a 4k UHD screen. The GUI on QGIS doesn't scale well making most of the menu elements to small to easily see.


Is there a way to change the scale of the gui?





Slope, Topographic Wetness Index


I am working on a project that requires me to extract values from rasters (viz the slope and TWI) for a set of point dataset that I have. I tried calculating the Slope, Flow accumulation and the TWI from the DEM (using ArcGIS 10.1) but somehow the slope and the TWI raster outputs seems erroneous! For slope, I get values ranging from 0 to 89 (file attached here) and for TWI, I get values between 19.58 and 9.40 (file attached), with no data data for most of the area! However, while extracting values for both slope and TWI to my point shape file, I mostly get 0 as the RASTERVALUE for most of the point data. Could anyone kindly review where exactly I am going wrong and how do I correctly get the slope and the TWI?enter image description here





How to do a flood simulation without flooding the whole area and covering surface structures (with DEM)?


I have a high resolution DEM and want to do a flood simulation starting at a river. My hope is that the water runs into historical (now dry) river channels (in which I'm interested in) at first and step by step. In my imagination the whole old channel system appears at the end. But the problem is, the higher the water raises the area which is covered by water gets bigger and bigger. Like in this pic (on the right): enter image description here


But I would love to get a result like on the left side. Now I hope i can describe this understandable: My idea is to do a flooding step by step and every step will be "saved". At the end you have several flood phases which you can intersect. enter image description here


Red, green and yellow are the different flood phases and the brighter blue is the intersection. I dont know how to manage this (even after internet research) or if it's realizable at all. Maybe you have an idea or even a better problem solution!? I use ArcGIS with extensions.





Need a simple sample mapcache.xml file that works with mapserver


I have a functioning mapserver installation runing on Ubuntu 14.04 and it's working fine. However, I would like to up the performance by putting mapcache in front of it.


I've installed mapcache, but I can't seem to create a valid mapcache.xml file.


I've found a number of 'complete' examples online, but I'm having trouble wrapping my head around all of the details.


Can someone point me to a minimal mapcache.xml file that simply forwards GetMap requests to mapserver and caches the resulting tiles? That would at least help get me started.


Thanks, Terry





How can I release the lock file on a DBF after removing its join to a FeatureLayer using ArcObjects?


I found another post with two different answers on how to remove the join between a feature layer and a standalone table, but neither method successfully removes the lock file (filename.dbf.COMPUTERNAME.####.####.sr.lock) as viewed in Windows explorer. I'm testing this by creating the join in ArcMap via right-clicking on a feature layer and creating a join through the Joins and Relates context menu item. The join is between a feature class in a personal and/or file geodatabase and a DBF table (not a shapefile). The DBF table is not loaded in the TOC.


Actually, Kirk's method may work but as it's written it produces an exception, and when "fixed" it (RemoveJoins1 below) the code runs but the join remains (and consequently the lock also remains). The other answer (RemoveJoins2 below) that uses IDisplayRelationshipClass successfully removes the join, but the lock file still remains.


Additional info: if I remove the join using the Joins and Relates context menu item and don't remove it using ArcObjects, then the lock file is released. So something in the code sample is causing ArcMap to keep the lock file even though the join is removed.


Any ideas how the lock file can be removed/released?



Public Sub RemoveJoins1(ByVal joinedLayer As IFeatureLayer)
Dim dTable As IDisplayTable = CType(joinedLayer, IDisplayTable)
Dim rqTable As IRelQueryTable = TryCast(dTable.DisplayTable, IRelQueryTable)
If Not rqTable Is Nothing Then
Debug.Print("source: {0}", CType(rqTable.SourceTable, IDataset).Name)
Debug.Print("dest: {0}", CType(rqTable.DestinationTable, IDataset).Name)
joinedLayer.FeatureClass = CType(rqTable.SourceTable, IFeatureClass)
Else
Debug.Print("there are no joins")
End If
End Sub

Public Sub RemoveJoins2(ByVal joinedLayer As IFeatureLayer)
Dim dTable As IDisplayTable = CType(joinedLayer, IDisplayTable)
Dim rqTable As IRelQueryTable = TryCast(dTable.DisplayTable, IRelQueryTable)
If Not rqTable Is Nothing Then
Debug.Print("source: {0}", CType(rqTable.SourceTable, IDataset).Name)
Debug.Print("dest: {0}", CType(rqTable.DestinationTable, IDataset).Name)

Dim drClass As IDisplayRelationshipClass = CType(joinedLayer, IDisplayRelationshipClass)
Dim rqTableInfo As IRelQueryTableInfo = CType(rqTable, IRelQueryTableInfo)
drClass.DisplayRelationshipClass(Nothing, esriJoinType.esriLeftInnerJoin)
Else
Debug.Print("there are no joins")
End If
End Sub




Get Center of Geometry in OpenLayers 3


Given a Geometry object in OpenLayers 3. How would one go about getting its center?


Older versions of OpenLayers provided a getCentroid method. There was also a getBounds workaround. But these appear to be removed in OpenLayers 3.





Importing large number of shapefiles into feature class using ArcPy with column mapping?


I'd like to write an ArcPy script to import a large number of shapefiles into an EXISTING feature class. I also need to be able to perform column mappings as there may be different column names. I need to write a script so I can automate this process.


I'm not looking for a complete script but rather advice as to where I should be looking to perform this task. I'm fairly new to ArcGIS.





Can GeoServer Mosaic extension footprints be something other than a shapefile?


According to the GeoServer documentation for the Image Mosaic extension...


http://ift.tt/1CTRDKg


It asks for a shapefile as the footprint data set. Does anyone know if the footprint can be any other type of data set, preferably PostGIS/PostgreSQL or ArcSDE / SQL ?





Making tool in arcmap by using modelbuilder or python


I am trying to making one tool by using python. For that I already make GUI. In that i have 5 inputs. These 5 inputs are feature layers(shape files). Now I make another option field. It is multiple choice option.


Now I want that all 5 input feature layer's fields that are add into this field option. From which I select some fields for further process.


I am using arcmap9.3, I make one toolbox and add my script as tool in that.


How can i do this?





OpenLayers map with Nominatim lookup function not working


I am trying to create a simple map with a search function, my minimal example is here: http://ift.tt/1yeSznf


For some reason the coords transformation after the script has received data from nominatim from EPSG 4326 to EPSG 3857 does not work well, even though it does work in an earlier instance in the script (right at the beginning).I have stepped through the function and the x - coord seems to be fine but the y - coord is wildly off.


Has anyone encountered a similar problem?


Cheers,


Tim.





Converting GML to Geodatabase format by using Productivity Suite software


I am using ArcGIS desktop 10.2 version and would like to import MasterMap Integrated Transport Network from Digimap to ArcGIS, So I was following the steps: 1 Install Productivity Suites v 3.4.1 2 import licence 3 Open OS MasterMap Data Converter. However, I got an error here about initialization error, which is shown below. Error


I dont know what the problem is..Could anyone help here?


Many thanks!! Nancy





Drawing line features using fixed angles


I have been googling this but I don't think I am using the right terms to get what I am looking for. I work for a water/waste water utility and we have fittings that determine the angle a pipe turns from another pipe, just like the plumbing in your home. What I am looking for is a tool that gives me a series of fixed angles, 90°, 45°, 22.5°, 11.25°, etc, so that when I select this angle I am only allowed to draw a line at the specified angle off the line I am snapped to, or off the previous line segment. Anyone know of any tools that are predefined to accomplish this, or know of away I can set something up?





how do I keep only highway roads and their nodes using osmfilter?


I am trying to filter a map from openstreetmaps using osmfilter to keep only highways (tag k) and the nodes that are at the extremes of these road segments. I have read many posts in different forums, but I haven't managed to find a decent solution yet.


Any hint will be highly appreciated!


Thanks a lot in advance.





Georeferencing using corner coordinate


I have thousands of tiff files with meta file containing corner coordinates. All images coordinates are different as they represent different locations. How can I georeference all these files using corner coordinates in IDL or python? Sample Meta file





GCS transformation


I have a shape POSGAR 1994, I tested several reprojections and I cannot delete a displacement of about 100 meters with google earth. These are the shape data:



PROJCS["POSGAR_1994_Argentina_Zone_5",
GEOGCS["GCS_POSGAR_1994",
DATUM["D_POSGAR_1994",
SPHEROID["GRS_1980",6378137.0,298.257222101]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],
PROJECTION["Transverse_Mercator"],
PARAMETER["False_Easting",5500000.0],
PARAMETER["False_Northing",0.0],
PARAMETER["Central_Meridian",-60.0],
PARAMETER["Scale_Factor",1.0],
PARAMETER["Latitude_Of_Origin",-90.0],
UNIT["Meter",1.0]]




Convert mapinfo styles toward qgis styles


Up to now, I has worked with mapinfo. I have a big vector layer (points) with a complex symbology.


For several days, I gave up mainfo for qgis. Is there a way to converting my mapinfo files (.tab) toward a file format supported by qgis. of course, i would like saving the symbology (styling) during the file conversion.


Thank you.





Geoprocessing service fails if output paramter is empty


I have made a network isolation model that lets the user pick a point on the network to simulate a pipe 'failure'/section that needs to be isolated and finds all valves that need to be turned and other affected features (hydrants, buildings, ect.). The model will output feature layers of those features found in the trace from the 4 feature classes, but only if a feature is found from the trace operations. This works fine in Arcmap when ran from the catalog, but not when ran from the server.


The problem is that not all outputs will contain a record for each FC. For instance, a trace may only return a pipe section and 2-3 valves, with no building connection points or hydrants returned. This works fine in ArcMap becuase i use a try/except to assign the results to the output parameters of the script, so if one of the FC has no selected records, the output is not assigned with anything. When ran on the server, this does not seem to work. When i run a process with no hydrants resulting from the trace, the model fails with Error Code 20010 - Invalid return value.


Does the server not adhere to the try/except function? or is there any way to return an empty feature layer if no results are returned for that FC?


Thanks for help





Create feature class/layer with data in python list [on hold]


I want to programmatically add a layer to an MXD. The data for the layer is a list of tuples. From I what see, I need to create a feature class with this data (called invalidDataList) Below is what I have so far.

How do I do this? (This code is incoherent at the for loop)



# invalidDataList is a list of tuples, each having name,lat,lon,township,range,section
mxd_filename = r"D:\My Documents\ArcGIS\TownshipRange.mxd"
mxd_file = arcpy.mapping.MapDocument(mxd_filename)
dataframe = arcpy.mapping.ListDataFrames(mxd_file)[0]

featureClass = r"D:\My Documents\ArcGIS\invaliddata"
feature_class_name = "invaliddata"
arcpy.MakeFeatureLayer_management(feature_class, feature_class_name)

for invalidData in arcpy.da.SearchCursor((
featureClass,
[NAME','LATITUDE','LONGITUDE','TOWNSHIP','RANGE','SECTION'']):
featureClassData.append(invalidData.name,
invalidData.latitude,
invalidData.longitude,
invalidData.plssTownship,
invalidData.plssRange,
invalidData.plssSection)

layer = arcpy.mapping.Layer(feature_class_name)
arcpy.mapping.AddLayer(dataframe, layer, "AUTO_ARRANGE")


Name: Smith Ranch latitude: 38.527444716 longitude: -107.637452472 plssTownship: 15S plssRange: 07W plssSection: 30

Name: Kinsley latitude: 39.34544716 longitude: -108.637452472 plssTownship: 5N plssRange: 01W plssSection: 3


Here is InvalidData class:



class InvalidData (object):

def __init__(self,
name = "",
latitude = "",
longitude = "",
plssTownship = "",
plssRange = "",
plssSection = "",
):

self.mineName = name
self.latitude = latitude
self.longitude = longitude
self.plssTownship = plssTownship
self.plssRange = plssRange
self.plssSection = plssSection




How to delete a feature class from a GDB using ArcObjects for Java?


I've seen this solution which may works in ArcObjects for VB/.Net:


How to overwrite a shapefile or feature class using arcobjects


When I try to convert it into Java, I get a ClassCastException on the IDataset cast.


Here is my code:



IWorkspace workspace = ...
IWorkspace2 workspace2 = (IWorkspace2)workspace;
if(workspace2.isNameExists(esriDatasetType.esriDTFeatureClass, featureClassName)) {
IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspace;
// ClassCastException here
IDataset featureClassDataset = (IDataset)featureWorkspace.openFeatureClass(featureClassName);
if(featureClassDataset.canDelete()) {
featureClassDataset.delete();
} else {
// alert: the feature class exists but couldn't be deleted
}
}
IFeatureClass featureClass = featureDataset.createFeatureClass(...);


Does anyone know how we can't use the IDataset interface for a feature class as in VB?


How to delete a feature class in Java else?





Shapefiles from Arcgis to Google Maps Api? + more


Can you add a large shapefile made in ArcGis to GoogleMaps? I have added it to ArcGis online and it takes a long time to load. I need to buy credits to put the shapefile tiled to ArcGis online (or so it seems) so I was trying to get the file to Google Maps. To have it tiled and to controle how much you can zoom in on the maps, it seems I need to move on to Google Maps Api. I have tried my best with this, spent many hours on researching on this but still havent even been able to tie my shapefile to Google Maps Api.


Do I need to put it as a kml online? And how to I tie it to the code so it shows on a google map? Ive also tried to restrich zooming options with no luck, even with heeps of codes that dont seem to work as I add them to the code that I have. Does anyone get this?


my maps:


This one is at a simple google maps, I cant load larger files, even in parts. Its also quite slow: http://ift.tt/164FsOD


This one is stored in Arcgis online and takes 20 sec to load....: http://ift.tt/164FsOD


My best, Lilja





Add field and number fields of different shape files


In my project I have 3 different shape files (shape1, shape2, shape3). All of them should get a new field (add field to attribute table). In this field I need to have a number (for shape1=1, shape2=2, shape3=3). Is this possible also for more than 100 shapes via batch processing?





Computing Shannon-Weiner biodiversity index using QGis [on hold]


I wonder if anybody has some experience in calculating biodiversity index (such as Shannon-Weiner) using QGis. I am also interested for similar experiences using R scripts within QGis. The analysis will use species count from individual stations of marine scientific surveys Many thanks.


Update To narrow my request, I have in mind to calculate the Shannon index of species diversity for each station of the sampling survey and then to "allocate" the average index within each cell of a vector grid or by interpolation in the Area of interest. I wonder if anyone has experience in doing this using a spatial query (providing stations and vector grid are stored in a sqlite database).





How to join point and polygon layers but retain polygon geometry for choropleth in ArcMap?


background: I tried to join a point layer and a polygon layer so that I could make a choropleth map of the attributes in the point layer but all I can get is a point map regardless of which layer I choose to initiate the join


use case: I wish to map rates of heart attack within by zip code normalized to population and symbolize with three quantiles in a choropleth map


things I tried: googled this question, read Kurland and Gorr GIS tutorial for health 5th ed


I'm using ArcMap 10.3.





Why script works on my computer but not on another?


The script below works perfectly fine in my computer. But when running the script on another computer, I receive an error:



Error: Algorithm not found



The computer has similar specifications to my own (Windows 7, 64-bit, no admin restrictions). I did the following steps for the computer to match the scripts requirements:



  • Installed OSGeo4W

  • Copied the processing folder from C:\OSGeo4W64\apps\qgis\python\plugins\processing\ to C:\Users\user_name\.qgis2\python\plugins\


Did I miss something obvious?



import os, sys, glob

from qgis.core import *
from qgis.gui import QgsMapCanvas
from PyQt4.QtGui import *
from os.path import expanduser
home = expanduser("~")

# Set a custom config path
QgsApplication( [], False, home + "\AppData\Local\Temp" )
QgsApplication.setPrefixPath("C:\\OSGeo4W64\\apps\\qgis", True)
QgsApplication.initQgis()
app = QApplication([])

# Folder path of the Results for shapefiles
path_dir = home + "\Desktop\Test\\"
path_res = path_dir + "Results\\"

# Prepare canvas framework from qgis_interface.py
sys.path.append( home + '/Desktop/Test//' )

# Get an iface object
canvas = QgsMapCanvas()
from qgis_interface import QgisInterface
iface = QgisInterface( canvas )

# Prepare processing framework
sys.path.append( home + '/.qgis2/python/plugins' )

# Initialize the Processing plugin passing an iface object
from processing.ProcessingPlugin import ProcessingPlugin
plugin = ProcessingPlugin(iface)
from processing.tools import *

Cellsize = 1000
layerPath = path_dir + "Layer.shp"
extent = QgsVectorLayer( layerPath, '', 'ogr' ).extent()
centerx = (extent.xMinimum() + extent.xMaximum()) / 2
centery = (extent.yMinimum() + extent.yMaximum()) / 2
width = extent.xMaximum() - extent.xMinimum()
height = extent.yMaximum() - extent.yMinimum()

def run():

outputs_1=general.runalg("qgis:creategrid", Cellsize, Cellsize, width, height, centerx, centery, 1, 'EPSG:7405', path_res + "/"+ fname)

run()
QgsApplication.exitQgis()
app.exit()




Why is OpenLayer addFeatures no working?


http://ift.tt/1A5QrDX


This is my website for test.


I want to put shape file in OpenLayer


Then, I find a example.


http://ift.tt/1zlqtt3


Try it and put my shape file in OpenLayer


So, use proj4 to convert EPSG:3826 to EPSG:4326


But, I can't addFeature in OpenLayer.


By the way, My shape file's projection is EPSG:3826





Costruction of a sqaure grid from a given centre(lat,lon) and direction of the sides


Let us consider a point (longitude,latitude) on earth (location).


My question is: how to construct a square grid around this point (taking this point as the centre of the square or intercept of the two diagonals) with size of the square as 0.1 degree times 0.1 degree and direction of the one side of square is theta degree?


For example let the sample point is (88.38045, 21.04247) and theta=70 degree. Here is a rough plot for clarification.


enter image description here


Thanks for attention and helps.





How can I merge two lines in 2.6.1-Brighton?


When I try to merge two lines selecting them and using the Merge Tool in the Advanced Editing Menu I get an error which says that merging these lines would result in an incompatible geometry for this layer so that it is cancelled. How can I merge lines? Thankes





How to include and format multiple rows in inforview from cartoDB


I have seen similar questions answered but I have not managed to find anything suitable.


I have some buildings and when I click on a building I want the name and website of the companies in it. I have thus a query that merges information from my buildings table and my companies table and this query often returns more than one row with multiple columns (at least company name and website).


I am trying to use the Custom HTML editor but when I use the Mustache tag to call the result, I only get the first row. How can I access the information in the next rows?


Note that I have also tried to use the aggregated strings as suggested somewhere else, but this is not good enough since I want also other columns and to decide the order and formatting... unless I can apply some string handling functions to it from the HTML, is this possible?


enter image description here


I have also seen some CartoDB.js, however this is used on the website that will display the map, but I do not have access to it. I will provide the cartoDB link so that the map is embedded in another website.





Getting error in ArcHydro


I have a problem with using ArcHydro. I tried to follow these steps:




  1. App utilities> Set target locations




    • Raster Data: C:users\seabell\Deskop\weekdata4\




    • Vector Data: C:users\seabell\Deskop\weekdata4\untitled.gdb





  2. Fill sinks

  3. Flow direction

  4. Flow accumulation

  5. Stream definition: I gave the number in area

  6. Stream segmentation

  7. Catchment grid deliniation

  8. Catchment polygon processing


I receive an error which is:



Error HRESLT E_FAIL has been returned from a call to a om Component



Can anyone help me?





"All the inputs are not current" after Precondition = false in Model Builder


I am using an Iterator to Iterate through a list of Strings for Feature Selection/Aggregation/Count. There is the possibility that no Features are aggregated. In this case, I want the iterator to go to the next %String%. However, in such a situation, the model runs as follows:



  • Executing (Iterate Field Values): IterateFieldValues ...

  • Succeeded ...

  • Executing (Select): Select ... Data.shp in_memory\TagFeaturesSelect ... LIKE '%;seo;%' - ...

  • Executing (Get Count): GetCount in_memory\TagFeaturesSelect

  • Row Count = 11

  • Executing (Calculate Value): CalculateValue check(11) "def check(rowcount)... Boolean

  • Value = true

  • ...

  • Executing (Aggregate Points): AggregatePoints in_memory\TagFeaturesSelect ...

  • Finding point clusters...

  • Constructing polygons...

  • ...

  • Executing (Get Count 2): GetCount C:\01_TOOLS\Intermediate\SelTaglocationsAgg.shp

  • Row Count = 0

  • The process did not execute because the precondition is false.

  • Succeeded at ...

  • Executing (Spatial Join): SpatialJoin ...\SelTaglocationsAgg.shp in_memory\TagFeaturesSelect ...\output_seo.shp ...

  • Start Time: ...

  • All the inputs are not current.

  • Succeeded at ...

  • Executing (Spatial Join (3)): ...

  • Start Time: ...

  • All the inputs are not current.

  • Succeeded at ...

  • Executing (Summary Statistics): ...

  • Start Time: ...

  • All the inputs are not current.

  • Succeeded at ... ...


This is the Model I am talking about: Model Diagram


I also tried using Calculate Value with result = false for Row Count = 0, but the same result. The Model also ignores whether I set [Row Count 2] as a precondition for [Spatial Join (3)] or not. My model still continues, but I get all the errors and I believe, this is not by intention?





Difference between raster subsets as defined by another raster


I wish to determine whether there is a relationship between slope and the Corine land cover class pastures. i.e. whether areas defined as pasture have a different slope to non-pasture areas.


I've tried some of the statistics tools in Arc but haven't had any success. Thus far I've:



  1. Extracted the pastures land cover class from the Corine raster

  2. Created a binary raster of pastures (pasture = 1, not pastures = 0)


How do I compare those slopes categorised as pasture and those that are non-pasture?


Has anybody calculated anything similar? Thanks





Trouble with select by attribute on ArcSDE


I am having trouble with with some extracts on a csv table on ArcSDE. Verifying my expression results in the following pop up: "The expression was verified successfully but not records were returned."





Postgis installation


I am installing Postgis on my Debian server, following these instructions:


http://ift.tt/1JTtDJt (Ubuntu / Debian)


http://ift.tt/1e2XYnN


However, after following the instructions it looks like I have installed PostGres (9.4), but no PostGIS.


Do I have to install something more that was omitted in the instructions?


Can I somehow add PostGIS as a PostGres Plugin?





Importing ArcGIS and/or CAD template into QGIS print composer.....Can it be done?


ArcGIS is used very widely in Environmental consultancy and the print/map templates used for reports are usually passed around in an MXD or CAD file format. Unfortunately we cannot afford ArcGIS and to be honest I much prefer QGIS.


At the moment we use the CAD file to then create a copy of the print template in the print composer. However this is a little time consuming and is pretty redundant work considering the MXD and CAD files are already at our disposal. Is there a way to simply import the print composer template either from a CAD file or MXD?


I've seen the MXD2QGS plugin for ArcGIS discussed in the thread, does this also create the print composer template or does it just export the layers?


We could feasibly ask our clients and people we work with to install this and do the conversion, but really I'm looking for a solution on the QGIS side.





PgRouting function wrapper


I'm trying to adapt the pgr_fromAtoB function to pgr_fromAtoMult replacing pgr_dijkstra function to pgr_drivingdistance.Here is the code:



CREATE OR REPLACE FUNCTION pgr_fromAtoMult(IN tbl character varying, IN x double precision, IN y double precision, OUT seq integer, OUT gid integer, OUT name text, OUT heading double precision, OUT cost double precision, OUT geom geometry)

RETURNS SETOF record AS
$BODY$
DECLARE
sql text;
rec record;
source integer;
point integer;
dist double precision;

BEGIN
-- Find nearest node
EXECUTE 'SELECT id::integer FROM layer_vertices_pgr
ORDER BY the_geom <-> ST_GeometryFromText(''POINT('
|| x || ' ' || y || ')'',4326) LIMIT 1' INTO rec;
source := rec.id;

-- Changing pgr_dijkstra to pgr_drivingdistance query
seq := 0;
sql := 'SELECT id, geom_way, osm_name, cost, source, target,
ST_Reverse(geom_way) AS flip_geom FROM

' ||
'pgr_drivingdistance(''SELECT id as id, source::int, dist::double precision, '
|| 'time_4::float AS cost FROM '
|| quote_ident(tbl) || ''', '
|| source || ', ' || dist
|| ' , false, false), '
|| quote_ident(tbl) || ' WHERE id2 = id ORDER BY seq';

-- Remember start point
point := source;

-- Flip geometry (if required)
IF ( point != rec.source ) THEN
rec.geom_way := rec.flip_geom;
point := rec.source;
ELSE
point := rec.target;
END IF;

-- Calculate heading (simplified)
EXECUTE 'SELECT degrees( ST_Azimuth(
ST_StartPoint(''' || rec.geom_way::text || '''),
ST_EndPoint(''' || rec.geom_way::text || ''') ) )'
INTO heading;

-- Return record
seq := seq + 1;
gid := rec.id;
name := rec.osm_name;
cost := rec.cost;
geom := rec.geom_way;
RETURN NEXT;

RETURN;
END;
$BODY$
LANGUAGE plpgsql VOLATILE STRICT
COST 100
ROWS 1000;
ALTER FUNCTION pgr_fromAtoMult(character varying, double precision, double precision)
OWNER TO postgres;


And here is the Error:



ERROR: el registro «rec» no tiene un campo «source»
CONTEXT: sentencia SQL: «SELECT ( point != rec.source )»
función PL/pgSQL pgr_fromAtoMult(character varying,double precision,double precision) en la línea 32 en IF
********** Error **********

ERROR: el registro «rec» no tiene un campo «source»
SQL state: 42703
Context: sentencia SQL: «SELECT ( point != rec.source )»




Unable to print using ArcGIS javascript under IE9


I am trying to print a web map using ArcGIS javascript 3.10 under IE9 but got RequestError: Unable to load /proxy?http://myserver:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task/execute status: 404. However, the same map printed without any problem for IE11, Chorme and Firefox. This seems to me is because of proxy error but only specific to IE9.


The codes as follow:



esriConfig.defaults.io.proxyUrl = "/proxy";
function createPrintDijit() {
var layoutTemplate, templateNames, mapOnlyIndex, templates;
var path = document.getElementById("path").value;
var printTitle = document.getElementById("printTitle").value;
var legendLayers = [];
var legendLayer = new LegendLayer();
legendLayer.layerId = "countryParks"
legendLayers.push(legendLayer);
legendLayer = new LegendLayer();
legendLayer.layerId = "amphibianGridMap"
legendLayers.push(legendLayer);
var layouts = [{
name: "Letter ANSI A Landscape",
label: "Landscape (PDF)",
format: "pdf",
options: {
legendLayers: legendLayers, // empty array means no legend
scalebarUnit: "Kilometers",
titleText: printTitle
}
}];
var templates = arrayUtils.map(layouts, function (lo) {
var t = new PrintTemplate();
t.layout = lo.name;
t.label = lo.label;
t.format = lo.format;
t.layoutOptions = lo.options;
return t;
});
app.printer = new Print({
map: app.map,
templates: templates,
url: "http://myserver/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
}, dom.byId("printButton"));
app.printer.startup();
}




Why ArcMap 10.2 crashes when running model?


I`m running a simple model in ArcMap 10.2, which makes my ArcMap crashing (closing and then an error message pops in saying that ArcMap has encountered a serious error, and there is an option to report it to ESRI). Basically I want to rasterise some polygons, so I built a model: Iterate Feature Class> Project> Polygon To Raster. Does anyone have an idea why my ArcMap crashes when I run this particular model? (I do run a lot of different model, but have never encountered this issue before...)





Print view or export to PDF


I am using OpenLayers Tile layer fot my map application. I have WMS layers on map like this:



  • Parcels,

  • Streets,

  • Buildings,

  • Gas Pipes,


I zoom to somewhere on map that all layers are visible. I want to select a region within a rectangle and get view as an image. After get image, I want to put it to PDF. How can I do this?





Copying features to new location


I want to copy some features from one layer and paste them onto another layer with all their attributes, but in a different geographic location. Is this possible? These are very small features a very long way apart, so the cursor-based 'move feature' tool is not really an option.


I'm using Qgis 2.6.


Thanks





Define a circle extent using the circle tool - arcgis javascript api


I have the following script for drawing a circle and I want to limit the user to a predefined radius:



$('#circle').click(function () {
clearPreviousSearch();
map.disableMapNavigation();
$('#run').fadeOut();
buttonclickvalue = 'circle';
drawToolbar.activate(esri.toolbars.Draw.CIRCLE);
});


Where should I specify that I want to define the specific radius using the ArcGIS API script?:



var symbol = new SimpleFillSymbol().setColor(null).outline.setColor("blue");
var gl = new GraphicsLayer({ id: "circles" });
var geodesic = dom.byId("geodesic");
map.addLayer(gl);
map.on("click", function(e) {
var radius = map.extent.getWidth() / 100;
var circle = new Circle({
center: e.mapPoint,
geodesic: domAttr.get(geodesic, "checked"),
radius: radius
});


Any help or pointers appreciated!





How to define title, description and color in leaflet Draw


I am trying to create a participatory mapping site where users can draw polygons using Leaflet draw.


Just to know how can i create a pop window where users can define a title, description and color of the polygon which they draw -or- after they draw, click on the feature and add a label,description and color?


Many thanks indeed.





jeudi 29 janvier 2015

Divide polygons into *n* number of groups of equal counts with ArcGIS 10.2


One of my tasks for work is to divide parcels into groups. These groups will be used by agents to talk to property owners. The goal is to make the agent's job easy by grouping parcels that are near each other together, as well as divide the parcels into equal numbers so that the work is distributed evenly. The number of agents can fluctuate from a couple to 10+.


Currently I perform this task manually, but would like to automate the process if at all possible. I've explored various ArcGIS tools, but none seem to suit my need. I tried a script (in python) that makes use of near_analysis and selecting of polygons, but it's rather random and takes forever to accomplish a semi-correct result that then takes me longer to fix than if I just did everything manually from the start.


Is there a reliable method to automate this task?


Results example (hopefully without the division we see in yellow):


Divided Parcels


Thanks!





Error message trying to Merge shapefiles in Python


I am quite new to Python - but this task should be not to complicated, but...


I try to merge all shapefiles from one File together into on, using this:



shapeList = arcpy.ListFeatureClasses()
print shapeList
for fc in shapeList:
if fc == "*domain*":
arcpy.Merge_management(shapeList, "MergeList")


But I always get this error message


Traceback (most recent call last): File "", line 1, in File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 3987, in Merge raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Datasets: -- HERE THE LIST OF FEATURECLASSES -- does not exist or is not supported Failed to execute (Merge).


I am sure there are only feature classes in the folder, when I try to use a Merge function I get the Error: ERROR 000338: Inputs must be either all Feature Classes, Tables or Rasters; not mixed. Failed to execute (Append). Failed at Thu Jan 29 16:22:28 2015 (Elapsed Time: 0.00 seconds)


I do not understand what is going on. Does anybody know what's going wrong?


Thanks a lot... I am getting crazy!


Frauke





GeoServer Style referencing SQL Server data store


I have a SQL server (2012) based data store in GeoServer (version 2.6) . For better readability I created a spatial layer with a whitespace in a column (attribute) name. enter image description here


Trying to use a style with the attribute "landslide code" reasults in an error.



org.geoserver.platform.ServiceException: The requested Style can not be used with this layer. The style specifies an attribute of landslide code and the layer is some layername


The problem seems to be the whitespace in the attribute name. I tried to use the xml coding for whitespace , no success. I also tried to encapsulate the attribute name in square brackets [], which is the standard for sql server. Also no success.


How can I use attribute names with whitespaces in their names? SQL server allows this!





Postgis: Conflation of two vector layers into a single layer


If I have table A that I consider to be definitive and table B that may have some elements missing from table B but also has geometries that are "close" to those in A that I want to ignore. How could I merge the two tables to get a conflated table C?


For reference this is Openstreetmap ways married with road data from another set.


Would I compare the start/middle and end points of the linestrings with table B to see if they were within X metres of any linestring in table A?





How can I merge two lines in 2.6.1-Brighton?


When I try to merge two lines selecting them and using the Merge Tool in the Advanced Editing Menu I get an error which says that merging these lines would result in an incompatible geometry for this layer so that it is cancelled. How can I merge lines? Thankes





Raster Calculator with conditional argument


I am trying to create a binary raster using the Raster Calculator in ArcGIS 10.2. I have a raster with ~20 different values, but I'm only interested in cells where the value = 10. I've been using the conditional argument, but I think there might be a problem with my variables having text associated with them; I keep getting "Error 000539: Runtime error Syntax Error: Keyword can't be an expression."


I've used the following:

Con("InputRaster" = 10, 1, 0)


This didn't specify where the variable values were, so I tried:

Con("InputRaster", "Value" = 10, 1, 0)


And then I tried enclosing the argument:

Con("InputRaster", '"Value" = 10', 1, 0)


In all instances, I received the exact same error message. In the "value" column in my attribute table, only numbers are listed, not text, so there shouldn't be an issue with non-numeric values. The associated text only appears in the table of contents, next to the numeric value. Any thoughts on how to fix my equation would be greatly appreciated.





Cities surface area


I'm looking for an api/service/db that contains the surface area of every city in the world.


For example, http://ift.tt/xutMBg, the box on the right contains that information.


I've searched but was unable to found anything useful. Google doesn't seems to have any API for that and I don't want to parse wikipedia. Even paid services are fine!


Thanks for the help :)





How to resample a 30m DEM to a 100m slope raster properly?


I need to resample a 30m DEM to a 100m slope raster. Do I just resample the 30m DEM directly to the 100m slope raster? or, do I convert the 30m DEM to a 100m DEM and then create a 100m slope raster from the new 100m DEM file?





Shapefile layers in QGIS don't display unless I zoom out


I have two shapefile layers in a Qgis project that have problems with zooming. One is a line I copied/pasted in a new layer from a set of height contours and the other one is a polygon layer I created by dissolving all features in another layer.


In both cases, the layers won't display unless the entirety of the layer shows in the canvas. When I zoom in or drag the view, as soon as part of the layer is out of the canvas the entire layer disappears.


In the case of the polygon layer, if I delete it and generate it again it works properly, but when I start filling the rings it reaches a point when it stops working well (I want to end up with a single polygon enclosing all features in the original layer). I guess it must have to do with the geometry of the layer, but I haven't found the cause.


Both layers previously worked well, and removing them/adding them again doesn't fix the issue.


All other layers in the project work well (including the set of height contours and the polygons layer I used to generate the troublesome layers).


This issue has shown in both Qgis 2.4 and 2.6


Is there anything I'm doing wrong?





QGIS 2.6.1 Complex polygon not displayed properly


I append two images of the same shape file which contains a single polygon with several "lakes". In SAGA it displays correctly with all the lakes as transparent but in QGIS the larger lakes contain the colour fill. Is there something I'm not doing correctly in QGIS, or is there an option for changing the way it imports a polygon?


Grateful for assistance.


QGIS polygon


SAGA polygon





Use osm2po to extract additional tags


We would like to improve our bike routing to also incorporate, for example, the information on the surface of the used streets. I don't quiet get how I should use the Osm2Po plugin in mechanism. I've set up my project in Eclipse and have a working development environment with a custom WayTagResolver (not sure if that is really needed) and a custom PostProcessor that in theory should write the additional information in the SQL file. Is there a tutorial anywhere that can help me? Any help is kindly appreciated. Daniel





Calculating distrubution of points compared to raster in arcgis


I'm trying to calculate the distribution of points against raster layer classes. What tool would suit this process best?





Using processing using other output (result from another algorithm) as input


I have a problem. I am developing a standalone app in python and I need to use processing algorithms. I was able to use one algorithm without erros but I need to run other processing algorithm which input is the output of the first one. So, my program stops in the first algorithm. Why it doesn't read the second one?





How to customize Configurable Map Viewer (CMV) to be available on two languages choosing with button click?


I want to make this application available on two languages (MK and EN) depending on whether the user choose (click) [MK] or [EN] button.


If I set variable loc = "MK", default application language will be "MK", but if I click on button [EN] to change the application language, I don't know how to reload dojoConfig.


I would really appreciate it if someone would help me with this problem. Thank You!


enter image description here





changing negative pixel spacing to positive


I have a bug with one application that does not handle negative pixel spacing values. Therefore I would like to change the negative pixel values of my images (geotif) into positive values (while keeping the georeferencing, of course.


I've tried with gdalwarp and gdal_translate but the output still remains in negative values. My workaround was to create a tfw, ten "manually" edit it to get positive Y values and changing the origin to lower left instead of upper left. However, I would like to know if there is an easier (and faster) method to achieve this. If possible using gdal.





Free Gis/Visualisation SDK for Java to Display Dynamic Traffics with Label


I need a GIS library to display dynamic aircraft tracks and their dynamic labels on an Earth Map. LuciadMap is a powerful tool which has AIS package for tracks and trajectory calculations and it has very powerful labeling mechanism.


But I need a free SDK to implement dynamic tracks and labels. Which Java SDK is suitable for this purposes?





Drawing line features using angles


I have been googling this but I don't think I am using the right terms to get what I am looking for. I work for a water/waste water utility and we have fittings the determine the angle a pipe turns from another pipe, just like the plumbing in your home. What I am looking for is a tool that gives me a series of angles, 90, 45, 22.5, 11.25, ect so that when I select this angle I am only allowed to draw a line at the specified angle off the line I am snapped to, or off the previous line segment. Anyone know of any tools that are predefined to accomplish this, or know of away I can set something up? Thanks for any input; Tyler





How to move features from one layer to another?


I have a polygon which belongs to a layer and I need to move it to another one. Is there a way to do it without drawing it again? Thanks!


Dani





QGIS Custom Symbols Group File Location


I am curious as to the location of the symbols group files.


I have created numerous custom symbols, as well as symbol groups.


I would like to share these with the people I work with.


Thank you!





Issues installing GDAL with PostgreSQL


I'm trying to install gdal-1.11.0 on CentOS 6 machine. Following the instructions, this is my config



./configure --prefix /usr/local --with-fgdb=/usr/local/FileGDB_API --with-pg=/usr/pgsql-9.3/bin/pg_config


As the configure process runs, I see this in the output:



checking for PostgreSQL... yes


However, at the end of the configure output, I see this:



PostgreSQL support: no


PostgreSQL 9.3 is up and running with postgis on it, the path to pg_config is correct. I know the configure is reading it, because if I put a bad path in --with-pg, it complains... I had prior installs of earlier versions of GDAL, and GDAL 1.11 without postgreSQL before I realized that I need to build it with PostgreSQL support. What am I missing?





Labeling in Word Wind


Is it possible to implement interactive labels in World Wind SDK. In API there is no labeling management interface for objects. Is there any usefull library that adds labeling mechanism to World Wind SDK.





Altitude of GPS cooridnates


Given two points a=(lat1, long1) , b=(lat2, long2).


I want to divide the line between a and b into points with equidistant length. (for example 100 Points)


For each of these points i need to retrieve the altitude.


How can i do this in Python 2.7





How to make dark gray background on TIF image transparent or white in QGIS


see also: Imported TIF has dark gray background instead of white


That question addresses why the TIF imported into QGIS has a dark gray background when the color set is set to 4096 when exported from PDFCreator. That file's gdalinfo shows NBITS=4


Here, in this question, I would like to know if there is a way to render the dark gray transparent, much in the way that entering a "0" in properties->transparency->no data value->additional no data value will make the black lines transparent.


Alternatively, is there a way to have QGIS render the dark gray as white?


I'm thinking, without much background in this, that adding custom color band transparency values will do the trick, but I have no way of gauging what the band values are for the dark gray


I tried looking at a histogram, and it drove a peak on the blue at 11 or so, and entering that value didn't help on the additional no data value, and I couldn't figure out what to enter on the custom boxes.


Ideas?





GDAL C++ API: How to create PNG or JPEG from scratch


I'm new to GIS and GDAL. My question probably is very basic, but I couldn't find answer. May be I don't understand GDAL ideology.


I need to create raster images from scratch, for example, JPEG or PNG. Their drivers don't support Create function - only CreateCopy. What is the common technique of new files creation in this case?


In principle, I can try to create Tiff because its driver suports Create(). Next, I can use CreateCopy() for PNG or JPEG using this Tiff. But such method looks indirect and unnatural for me. Also I suppose that this procedure can be too memory hungry if rasters are large.


I dealt with some image libraries before, they usually provide direct and simple way of bitmaps creation. Could somebody show me right direction for GDAL?


Thank you in advance,


Alexei





Track Traffic Display in World Wind


Is it possible to play records which has trajectories and time stamps as live traffics. I did investigate the World Wind SDK but I can not see special classes for aviation or Tracks and trajectory calculations.





Finding the Python script used by an ArcMap add-in


I've been asked by somebody at work to design a toolbar add-in that works just the same as an existing one, but with a different set of data. However, the person who wrote the original add-in for him has left the company, and did not document his work at all.


The only thing available to me is the MXD. How do I find what Python script(s) is triggered by a toolbar add-in, and where the script lives? (The requester is working in ArcMap 9.3, and while I have ArcMap 10.2 available to me, I have to design to 9.3 so he'll be able to use it.)


An obvious workaround is just writing something new from scratch. The desired workflow is fairly simple: iterate through a bunch of groups of data and make a PDF, thereby automating the process of making 100+ maps. But just like this analyst is simplifying his job by using a one-click button, I'd like to simplify my job by basing the new script on the existing, proven script :-)





Imported TIF is dark gray


using QGIS 2.6


I import a TIF file, and expect the import to show an image that has black lines on a white background (with some other colors here and there), as the native windows viewer will see a white background. The file, 49MB, imports, but


The TIF image has a dark gray background instead of a white background


I can't tell why. Any hints?


The same thing happens if I import the TIF image into georeference, which is how I discovered this in the first place.


I created/exported the TIF image using PDFCreator (from a print of a PDF to a TIF, using that program). Within PDFCreator, I chose a TIF export that set the color map to 4096 colors, as the default created a TIF file that was twice as large.


On testing with the default size (16 million colors or some such).... That file imported and showed the background as white.


And I can't tell why, for that, either. Any hints?


======== In response to the comment/question by @BradHards:


The TIFFTAG_PHOTOMETRIC is not present in either file.


The gdalinfo for the large file and small file are identical, but for the presence of two extra lines on the file where the white background turns to dark gray. Each band sets NBITS=4 for Image Structure Metadata: eg:



Band 1 Block=5100x68 Type=Byte, ColorInterp=Red
Image Structure Metadata:
NBITS=4
Band 2 Block=5100x68 Type=Byte, ColorInterp=Green
Image Structure Metadata:
NBITS=4
Band 3 Block=5100x68 Type=Byte, ColorInterp=Blue
Image Structure Metadata:
NBITS=4

Something about the NBITS=4 state turns the import turn dark gray. Alternatively, there is some other problem with the PDFCreator export.


These are the full GDALInfo:


Small with dark gray background:



Driver: GTiff/GeoTIFF
Files: small file.tif
Size is 5100, 6600
Coordinate System is `'
Metadata:
TIFFTAG_DATETIME=2015:01:28 16:41:04
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
TIFFTAG_SOFTWARE=GPL Ghostscript 9.07
TIFFTAG_XRESOLUTION=600
TIFFTAG_YRESOLUTION=600
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 6600.0)
Upper Right ( 5100.0, 0.0)
Lower Right ( 5100.0, 6600.0)
Center ( 2550.0, 3300.0)
Band 1 Block=5100x68 Type=Byte, ColorInterp=Red
Image Structure Metadata:
NBITS=4
Band 2 Block=5100x68 Type=Byte, ColorInterp=Green
Image Structure Metadata:
NBITS=4
Band 3 Block=5100x68 Type=Byte, ColorInterp=Blue
Image Structure Metadata:
NBITS=4

Large with white background



Driver: GTiff/GeoTIFF
Files: larger file.tif
Size is 5100, 6600
Coordinate System is `'
Metadata:
TIFFTAG_DATETIME=2015:01:28 17:07:16
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
TIFFTAG_SOFTWARE=GPL Ghostscript 9.07
TIFFTAG_XRESOLUTION=600
TIFFTAG_YRESOLUTION=600
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 6600.0)
Upper Right ( 5100.0, 0.0)
Lower Right ( 5100.0, 6600.0)
Center ( 2550.0, 3300.0)
Band 1 Block=5100x68 Type=Byte, ColorInterp=Red
Band 2 Block=5100x68 Type=Byte, ColorInterp=Green
Band 3 Block=5100x68 Type=Byte, ColorInterp=Blue



GeoNode: where is pyCSW metadata repository stored?


I have a working instance of GeoNode 2.0 over Debian7 (with PostgreSQL) and I want to know where does pyCSW stores the metadata by default. And if it's possible, how to set it to the same PSQL server.


Thanks in advance.





Resources to integration with external web service at desktop level


I am using ESRI based GIS software, I looking a way to integrate ESRI solutions with external web service of other information system (CRM,ERP) and to develop custom applications for the collection, conversion, maintenance, and analysis of data. Mainly visualization of external data in maps when data is streamed online


1. is it possible with out ArcGIS Server ? I'm using version 10.1 Advance level


2.Where can i find resources to integrate GIS to external web service at desktop level ? I have no idea on where to start and to proceed further.


3.What ArcMap Tools and Commands host the trigger for calling the services ?





Generate layers based on feature values


First of all, I am very new to the GIS world, so bear with me if the question is stupid.


I am using ArcGIS and here's what I try to accomplish:


I have a feature class (let's call it Areas) storing polygons with some extra data (name, id etc). If I create a layer and publish this as a MapService, I can use it in my .NET application (or in the browser via REST) to display a layer containing all the Areas. In my app, I can even do filtering (with LayerDefinitions) to only display a certain area at a time.


What I would like to do is (within the ArcGIS server, so that it is reflected on all clients) have one layer for each of the Areas in the feature table.


So the REST directory in a browser would display:


Layers:



  • Areas

    • Area 1

    • Area 2

    • Area 3




And I would be able to see the same structure in a TOC and control visibility on/off on each of the Areas.


The "projection" of turning every feature into a separate layer must be dynamic, so that if I add another Area, it would automatically become a new layer (IE no configuration or republishing the MapService).


Is this possible within ArcMap? Can I code it in Python and have it run inside the MapService somehow? Do I have to write a SOE ? Or isn't it possible at all (only on the client side)?


Thanks in advance, for any guidance on this issue.


/Tormod





Postgres: plpgsql combine ST_Overlaps and ST_Intersects


I have a question regarding creating a trigger function in postgres with 2 conditions:


when creating a linestring in QGIS their must either overlap nor intersect. So i wrote 2 function, each working with either ST_Overlaps or ST_Intersects.



CREATE OR REPLACE FUNCTION check_linesintersecting() RETURNS TRIGGER AS
$BODY$
DECLARE
BEGIN
IF TG_OP = 'INSERT'
THEN
IF
(SELECT COUNT(*)
FROM
(SELECT gid
FROM line_layer AS t
WHERE st_intersects(NEW.geom, t.geom)) AS foo)
THEN
RAISE EXCEPTION 'Speicherung abgebrochen: Ueberschneidende Linien!';
RETURN NULL;
ELSE
RETURN NEW;
END IF;
ELSIF TG_OP = 'UPDATE'
THEN
IF
(SELECT COUNT(*)
FROM
(SELECT gid
FROM line_layer AS t
WHERE st_intersects(NEW.geom, t.geom)
AND (t.gid <> OLD.gid)) AS foo) > 0
THEN
RAISE EXCEPTION 'Speicherung abgebrochen: Ueberschneidende Linien!';
RETURN NULL;
ELSE RETURN NEW;
END IF;
END IF;

END;
$BODY$
LANGUAGE plpgsql;


All I had to to in oder to make it detect overlapping was to change the ST_Intersects into ST_Overlaps.


But how can I combinde ST_Overlaps and ST_Intersects? I've tried using the same loop right after each other but only the the first function then is working. Any clues? Thanks in advance!!