Hot answers tagged code
7
For starters, you could include sw in your wildcard statement (*sw.txt), which presumably would reduce your number of returned records substantially (assuming you have ne, nw, se, etc).
Second, now that you're working with a subset of files, use a conditional statement to widdle down your files to your exact needs.
Pseudo Code:
Set workspace (directory)
...
5
It's input redirection -- just like you can redirect the output of a command into a file,:
command > outfile.txt
you can redirect the input from a file:
command < infile.txt
This is the same as:
cat infile.txt | command
Hopefully helpful!
4
The syntax for combobox (as well as other controls) is different in VB.NET. You should review the help to see the changes.
cmbBox.ListCount --> cmbBox.Items.Count
cmbBox.List(l) --> cmbBox.Items.Item(l)
cmbBox.AddItem(sItem, l) --> cmbBox.Items.Insert(l, sItem)
cmbBox.AddItem(sItem) --> cmbBox.Items.Add(sItem)
3
type your resolution of raster not "resolution" . also don't type +*/= by keyboard . use raster calculator buttons .
resolution of your raster :
right click your raster. click properties
go to source tab .
cellsize(x,y) is your resolution
3
you can do it with this way:
import os
import random
yourMainFolder = r'C:/out'
range1 = 3609902sw
range2 = 3610032sw
newAry = []
for a in (int(range1[:-2]) - 1, int(range2[:-2] + 1)):
newAry.append(str(a) + range2[-2:])
for dirname, dirnames, filenames in os.walk('yourMainFolder'):
for subdirname in dirnames:
path = ...
2
You could try the .NET library Proj.Net. See the Loading a projection by Spatial Reference ID page for how to add in the GB National Grid.
Example code from this forum post:
CoordinateSystemFactory c = new CoordinateSystemFactory();
ICoordinateSystem target = c.CreateFromWkt("PROJCS[\"OSGB 1936 / British National Grid\",GEOGCS[\"OSGB ...
2
The Attribute Assistant allows you to take field values from intersecting or nearby features and put them in specified fields of the created feature. It can be configured to populate fields when a feature is created, or on a selected set of features, and when you update a feature's attributes or position.
There is a tutorial here, and a blog post on how I ...
1
Anyone with more info can edit this answer.
The edcommunity has a sample app, but no downloadable code. As per KHibma the clip and ship will probably work.
If you aren't clipping the Edcommunity Sketch-A-Map app uses a draw widget to export.
1
If you like Python, how about the titlecase module?
http://muffinresearch.co.uk/archives/2008/05/27/titlecasepy-titlecase-in-python/
It's decent, and works for English. Of course there will always be exceptions or gray areas (see my comment under the question above).
1
I'm pretty sure the answer lies in setting the zIndex (map.setLayerZIndex or layer.setZIndex).
I believe the features of the vector layer are treated differently and the zIndex value is magnified though I couldn't confirm this in the code:
Z_INDEX_BASE: {
BaseLayer: 100,
Overlay: 325,
Feature: 725,
Popup: 750,
Control: 1000
},
Try ...
1
Have you tried using getFeaturesByAttribute() instead of getFeature()? The former looks up using attributes (I think this is what you are trying to do), while the latter looks up using properties.
1
you can use getFeatureBy method:
var lyr = new OpenLayers.Layer.Vector("test");
var ft = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(10, 10),
{scientific_name:'hydro'});
map.addLayer(lyr);
lyr.addFeatures([ft]);
var features = lyr.getFeatureBy('scientific_name', 'hydro');
and for highlighting them with scientific name you ...
1
This is how I solved the problem:
import psycopg2
import re
def replace(matchObj):
# Group 0 is all groups, group 1 is the first match contained in
# parentheses. Group 2 is the whole float value.
value = float(matchObj.group(2))
value = value - 360
return matchObj.group(1) + str(value) + " "
def main():
# connect to postgresql
...
Only top voted, non community-wiki answers of a minimum length are eligible
