Feature Layer: A layer that references a set of feature data. Feature data represents geographic entities as points, lines, and polygons.
Feature Class:In ArcGIS, a collection of geographic features with the same geometry type (such as point, line, or polygon), the same attributes, and the same spatial reference. Feature classes can be stored in geodatabases, shapefiles, coverages, or other data formats. Feature classes allow homogeneous features to be grouped into a single unit for data storage purposes. For example, highways, primary roads, and secondary roads can be grouped into a line feature class named "roads." In a geodatabase, feature classes can also store annotation and dimensions.
Rasterized Feature Layer: A feature layer in ArcGlobe that exists as points, lines and polygons but is rendered as cell data. When layers are added to ArcGlobe, they may automatically be rendered in raster format to retain their cartographic symbology.
Friday, December 30, 2016
Monday, December 12, 2016
Register Database to ArcGIS server
There are two methods to register Database to ArcGIS Server
A) Register via ArcGIS Desktop
B) Register via ArcGIS Server Manager Web Interface
SOURCE: http://gisdeveloper.blogspot.com/2014_04_01_archive.html ( Copied here for my future reference)
REGISTER DATABASE TO ARCGIS SERVER
While publishing data (from database) to ArcGIS server it gives you a warning that
A) Register via ArcGIS Desktop
- Double click to ensure ArcGIS Server Instance is connected to ArcGIS Desktop
- Right Click to Publisher connection to ArcGIS Server
- Then Click ArcGIS Server Properties to open ArcGIS Server Properies
- Add Data Store in Registered Databases
B) Register via ArcGIS Server Manager Web Interface
SOURCE: http://gisdeveloper.blogspot.com/2014_04_01_archive.html ( Copied here for my future reference)
REGISTER DATABASE TO ARCGIS SERVER
While publishing data (from database) to ArcGIS server it gives you a warning that
24011: Data source is not registered with the server and data will be copied to the server
How to resolve this ??
Well there are different approaches, here is the one which i followed. But before doing anything Please Note:
Note: The client side libraries need to be copied to ArcGIS server's bin folder. What does this mean ??
Well you have to copy the libraries (obtained from esri's customer portal Or simply google it "PostgreSQLClientLibs922" Or PostgreSQL libraries for ArcGIS server)
Copy the correct version of libraries to
C:\Program Files\ArcGIS\Server\bin
Note to see the correct version of libraries click here.
Now,
Note: The client side libraries need to be copied to ArcGIS server's bin folder. What does this mean ??
Well you have to copy the libraries (obtained from esri's customer portal Or simply google it "PostgreSQLClientLibs922" Or PostgreSQL libraries for ArcGIS server)
Copy the correct version of libraries to
C:\Program Files\ArcGIS\Server\bin
Note to see the correct version of libraries click here.
Now,
- Open ArcGIS server Manager from (prefer Internet Explorer)http://localhost:6080/arcgis/manager/site.html
- Sign in to your ArcGIS server account
- On home Page under Directories tab click on Data Store
- Click on Registered Database
Monday, December 5, 2016
Postgresql tips
Start to postgresql : sudo -u postgres psql postgres
Connect to database : \connect database_name
Drop all tables from a database: drop schema public cascade;
List all databases :
\list
or\l
: list all databases\dt
: list all tables in the current database
\q
and then press ENTER
to quit psql
Connect to database : \connect database_name
Drop all tables from a database: drop schema public cascade;
Tuesday, November 22, 2016
American Association of Geographers' Annual Meeting2017
American Association of Geographers' Annual Meeting in Boston, MA
Welcome to Boston
2017 AAG Annual Meeting
April 5-9, 2017
Hynes Convention Center
Welcome to the 2017 American Association of Geographers' Annual Meeting in Boston, MA! You will be joined by fellow geographers, GIS specialists, environmental scientists, and other leaders for the latest in research and applications in geography, sustainability, and GIScience. The meeting will be held from April 5-9, 2017, and will feature over 6,600 presentations, posters, workshops, and field trips by leading scholars, experts, and researchers.
The 2017 Meeting will be headquartered at the Hynes Convention Center, located in the Back Bay neighborhood of Boston. Sessions and events will also take place at the official 2017 AAG Meeting hotels: the Sheraton Boston and the Marriott Copley Place. The additional meeting venues are located steps away from the Hynes Convention Center.
Featured Themes
Each year, the AAG identifies a few themes for its Annual Meeting to help focus discussion and provide a fresh and engaging structure to the conference program. Of course, attendees are also invited to develop themes relevant to the meeting's location or influenced by political and intellectual trends within the discipline. As always, any topic relevant to geography is welcome at the AAG Annual Meeting.
The Featured Themes for the 2017 Annual Meeting are:
The Featured Themes for the 2017 Annual Meeting are:
- Geographies of Bread and Water in the 21st Century
- Mainstreaming Human Rights in Geography and at the AAG
- Uncertainty and Context in Geography and GIScience
American Geophysical Union Fall Meeting 2016
Announcements
With approximately 24,000 attendees in 2015, AGU’s Fall Meeting is the largest Earth and space science meeting in the world. This year will mark Fall Meeting’s 49th year as the premiere place to present your research; hear about the latest discoveries, trends, and challenges in the field; and network with colleagues that can enhance your career.
Fall Meeting sessions are held at the Moscone Convention Center. The center is located at the edge of the city’s dynamic South of Market district and just four blocks from Union Square, the city’s vibrant shopping district, and the Powell Street cable car to Nob Hill, Chinatown, and Fisherman’s Wharf.
Fall Meeting brings together the entire Earth and space science community from across the globe for discussions of emerging trends and the latest research. The technical program includes presentations on new and cutting-edge science, much of which has not yet been published, meaning you’ll return to work with knowledge you can’t get anywhere else.
With more than 1,700 sessions in 2015, Fall Meeting’s scientific program spans the Earth and space sciences, offering something for everyone no matter their scientific discipline. The meeting offers a unique mix of more than 20,000 oral and poster presentations, a broad range of keynote lectures, various types of formal and informal networking and career advancement opportunities, and an exhibit hall packed with hundreds of exhibitors showcasing new and relevant research tools and services that meet the professional needs of our attendees year after year. Join us in 2016 for another dynamic experience.
About Fall Meeting
Fall Meeting is the largest worldwide conference in the geophysical sciences, attracting more than 24,000 Earth and space scientists, educators, students, and other leaders. Now in its 49th year, Fall Meeting brings together the entire Earth and space science community from across the globe for discussions of emerging trends and the latest research. The technical program includes presentations on new and cutting-edge science, much of which has not yet been published, meaning you’ll return to work with knowledge you can’t get anywhere else.
Fall Meeting offers a unique mix of more than 20,000 oral and poster presentations, a broad range of keynote sessions, various types of formal and informal networking and career advancement opportunities, and an exhibit hall packed with hundreds of exhibitors showcasing new and relevant research tools and services that meet the professional needs of our attendees’ year after year.
International Conference on Advances in Geographic Information Systems 2016
24th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems (ACM SIGSPATIAL 2016) Annoucements
Monday October 31 - Thursday November 3, 2016 — San Francisco Airport Marriott Waterfront, California, USA
The ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems 2016 (ACM SIGSPATIAL 2016) is the twenty-fourth event in a series of symposia and workshops that began in 1993 with the aim of bringing together researchers, developers, users, and practitioners in relation to novel systems based on geo-spatial data and knowledge, and fostering interdisciplinary discussions and research in all aspects of geographic information systems. The conference provides a forum for original research contributions covering all conceptual, design, and implementation aspects of geospatial data ranging from applications, user interfaces, and visualization to data storage and query processing and indexing. The conference is the premier annual event of the ACM Special Interest Group on Spatial Information (ACM SIGSPATIAL). Researchers, students, and practitioners are invited to submit their contributions to ACM SIGSPATIAL 2016.
2017 Esri Developer Summit
2017 ESRI Developer Summit Announcements
The ESRI DevSummit has everything you need for building next-generation apps with advanced mapping and analysis tools from Esri. For developer, by developers is going to held on March 7-10, 2017, Palm Springs Convention Center.
Following Tech stack will cover during the summit -
Discover ways to better leverage your GIS investment, and test-drive ArcGIS on a variety of devices. Streamline how you build native applications with ArcGIS Runtime SDKs. Plus, bounce ideas and challenges off the staff responsible for building and implementing Runtime SDKs.
Desktop Development
Explore best practices for development patterns, prolem solving, deployment challenges, and platform integration. Then get your questions answered by the people responbible for building and deploying apps with ArcObjects, Python, and the ArcGIS SDK for the Microsoft. NET framework.
International Conference for Free and Open Source Software for Geospatial - FOSS4G 2017
FOSS4G Boston 2017 Announcements
The annual FOSS4G conference is the largest global gathering focused on open source geospatial software. FOSS4G brings together developers, users, decision-makers and observers from a broad spectrum of organizations and fields of operation. Through six days of workshops, presentations, discussions, and cooperation, FOSS4G participants create effective and relevant geospatial products, standards, and protocols.
FOSS4G has been held all over the world and draws attendees from over 40 countries. Bonn, Germany hosted the conference in 2016. In 2017, Boston, Massachusetts, USA will host on August 14-19, 2017
Friday, November 4, 2016
Prevent local branch overwrite - Git pull origin
- Reset your local
master
to match the remote repository'smaster
(WARNING: be sure that you don't have any uncommitted changes you want to keep before issuing the following command):git reset --hard origin/master
- Fetch all remote branches into your local repository:
git fetch origin
- Create a new local
vsup12
branch from the remotevsup12
branch, and switch to this new local branch:git checkout -b vsup12 origin/vsup12
Monday, September 26, 2016
Copying files from a remote Unix to local Windows system with cygwin
scp -r <user_name>@<host_name or host_ip>:<Path to your directory> <target_path_dir>
then command will look like this:
scp -r patwa@UnixServer:/home/patwa/mywork /cygdrive/d/patwa
if above command gives error for "/cygdrive/d/patwa"
than
cd /cygdrive/d/patwa
scp -r patwa@UnixServer:/home/patwa/mywork .
then command will look like this:
scp -r patwa@UnixServer:/home/patwa/mywork /cygdrive/d/patwa
if above command gives error for "/cygdrive/d/patwa"
than
cd /cygdrive/d/patwa
scp -r patwa@UnixServer:/home/patwa/mywork .
Thursday, September 22, 2016
Export/Imoprt PostgreSQL database with PostGIS extension
#Run from windows command prompt
#Create dump into dump.sql
C:\Program Files\PostgreSQL\9.4\bin>pg_dump.exe -h localhost -p 5432 -U username dbnameToExport > D:\dump.sql
#Import dump
C:\Program Files\PostgreSQL\9.4\bin>psql.exe -h localhost -p 5432 -U postgres dbnameToImport < D:/dump.sql
Password for user postgres:
Only super user can create PostGIS extension in PostgreSQL.
Reproject Geometry from WGS84 to Web Mercator Aux
ALTER TABLE table_name
ALTER COLUMN column_name TYPE geometry(MultiPolygon, 3857) USING ST_Transform(ST_SetSRID(column_name,4326),3857) ;
Linux, import Postgresql dump with Postgresql database:
psql -h hostname -d databasename -U username -f dumpfile.sql
#Create dump into dump.sql
C:\Program Files\PostgreSQL\9.4\bin>pg_dump.exe -h localhost -p 5432 -U username dbnameToExport > D:\dump.sql
#Import dump
C:\Program Files\PostgreSQL\9.4\bin>psql.exe -h localhost -p 5432 -U postgres dbnameToImport < D:/dump.sql
Password for user postgres:
Only super user can create PostGIS extension in PostgreSQL.
Reproject Geometry from WGS84 to Web Mercator Aux
ALTER TABLE table_name
ALTER COLUMN column_name TYPE geometry(MultiPolygon, 3857) USING ST_Transform(ST_SetSRID(column_name,4326),3857) ;
Linux, import Postgresql dump with Postgresql database:
psql -h hostname -d databasename -U username -f dumpfile.sql
Thursday, September 8, 2016
Solution: Vagrant stopped working - `open': Access is denied. (5) (ChildProcess::Error)
ERROR from CMD with out running vagrant up as administrator
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["showvminfo", "18021ea0-83ee-43c3-9adb-26ad7eb0c6ca"]
Stderr: VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Code CO_E_SERVER_EXEC_FAILURE (0x80080005) - Server execu
tion failed (extended info not available)
VBoxManage.exe: error: Most likely, the VirtualBox COM server is not running or
failed to start.
Error on running vagrant up as administrator from CMD
Similar issue on Question from Stack Overflow
Fix steps for my machine-
1. Installed fresh - Vagrant (1.8.5)
2. Installed fresh Virtual box VirtualBox 5.1.4 for Windows host x86/amd64 - Version 5.1.4 r110228 (Qt5.5.1)
3. Install Git bash version 2.8.2.windows.1 (64 bit)
4. Running Git bash as admin and calling vagrant up through that elevated console
Solution-
https://laracasts.com/discuss/channels/servers/vagrant-up-failing-trying-to-add-to-hosts
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["showvminfo", "18021ea0-83ee-43c3-9adb-26ad7eb0c6ca"]
Stderr: VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Code CO_E_SERVER_EXEC_FAILURE (0x80080005) - Server execu
tion failed (extended info not available)
VBoxManage.exe: error: Most likely, the VirtualBox COM server is not running or
failed to start.
Error on running vagrant up as administrator from CMD
C:/HashiCorp/Vagrant/embedded/gems/gems/childprocess-0.5.9/lib/childprocess/wind
ows/handle.rb:12:in `open': Access is denied. (5) (ChildProcess::Error)
from C:/HashiCorp/Vagrant/embedded/gems/gems/childprocess-0.5.9/lib/chil
dprocess/windows/process.rb:70:in `launch_process'
from C:/HashiCorp/Vagrant/embedded/gems/gems/childprocess-0.5.9/lib/chil
dprocess/abstract_process.rb:82:in `start'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/u
til/subprocess.rb:122:in `block in execute'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/u
til/safe_chdir.rb:26:in `block (2 levels) in safe_chdir'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/u
til/safe_chdir.rb:25:in `chdir'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/u
til/safe_chdir.rb:25:in `block in safe_chdir'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/u
til/safe_chdir.rb:24:in `synchronize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/u
til/safe_chdir.rb:24:in `safe_chdir'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/u
til/subprocess.rb:121:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/u
til/subprocess.rb:22:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/u
til/platform.rb:129:in `cygwin_windows_path'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/provi
ders/virtualbox/driver/base.rb:50:in `block in initialize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/provi
ders/virtualbox/driver/base.rb:42:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/provi
ders/virtualbox/driver/base.rb:42:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/provi
ders/virtualbox/driver/meta.rb:36:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/provi
ders/virtualbox/provider.rb:20:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/provi
ders/virtualbox/provider.rb:20:in `usable?'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/v
agrantfile.rb:138:in `machine_config'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/v
agrantfile.rb:45:in `machine'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/e
nvironment.rb:663:in `machine'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/p
lugin/v2/command.rb:177:in `block in with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/p
lugin/v2/command.rb:201:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/p
lugin/v2/command.rb:201:in `block in with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/p
lugin/v2/command.rb:183:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/p
lugin/v2/command.rb:183:in `with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/comma
nds/up/command.rb:131:in `install_providers'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/comma
nds/up/command.rb:85:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/c
li.rb:42:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/e
nvironment.rb:302:in `cli'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/bin/vagrant:1
74:in `<main>'
Similar issue on Question from Stack Overflow
Fix steps for my machine-
1. Installed fresh - Vagrant (1.8.5)
2. Installed fresh Virtual box VirtualBox 5.1.4 for Windows host x86/amd64 - Version 5.1.4 r110228 (Qt5.5.1)
3. Install Git bash version 2.8.2.windows.1 (64 bit)
4. Running Git bash as admin and calling vagrant up through that elevated console
Solution-
https://laracasts.com/discuss/channels/servers/vagrant-up-failing-trying-to-add-to-hosts
Friday, August 19, 2016
Code snippet: Open Folder Browser Dialog in WPF
Install WPFFolderBrowser 1.0.2 from nuget gallery to use the Windows Vista / Windows 7 Folder Browser Dialog from your WPF projects, without any additional dependencies.
Install-Package WPFFolderBrowser
then import WPFFolderBrowser
Install-Package WPFFolderBrowser
then import WPFFolderBrowser
using WPFFolderBrowser;
private void BrowseFolder() { WPFFolderBrowserDialog dd = new WPFFolderBrowserDialog(); var result = dd.ShowDialog(); if (result.HasValue) { TxtFvsAccessDbPath = dd.FileName; } }
Code snippet: WPF UWP ListView SelectionChanged Event Handling in ViewModel
Solution from Dhaval Patel in Sliverlight application works perfectly on my WPF application. I prefer his idea because it is more clear and cleaner than other solutions that I have came with. The event handling approach explained as -"This is the way where You can Reach the Selection changed events in Your MVVM Application First Of all i tell you that Command Property only work in Button now we have to Explicitly binding that property in our Selection Changed event like List box or combo box in Your XMAL file"
<ListBox Name="MyListBox" ItemsSource="{Binding ListItems}" Height="150" Width="150" Margin="281,32,-31,118">
<Local:Interaction.Triggers>
<Local:EventTrigger EventName="SelectionChanged">
<Local:InvokeCommandAction Command="{Binding MyCommand}" CommandParameter="{Binding ElementName=MyListBox,Path=SelectedItem}"/>
</Local:EventTrigger>
</Local:Interaction.Triggers>
</ListBox>
for this you have to add dll Syatem.Windows.Interactivity now u have to add references in your xaml file namespace like
xmlns:Local="clr-namespace:System.Windows.Interactivityassembly=System.Windows.Interactivity"
Thursday, August 18, 2016
Code snippet: Data binding between ViewModel and Radio Button in WPF
Following example shows the data binding between radio buttons and ViewModel in WPF.
Parts of View.xaml
<Grid.Resources> <Utilities:RadioHelper x:Key="RadioConverter" /> <Utilities:RadioHelper x:Key="InverseRadioConverter" Inverse="True" /> </Grid.Resources> <RadioButton Name="radFvsOracle" GroupName="fvsStorage" Content="Oracle" Margin="7,0,0,0" IsChecked="{Binding Path=RadFvsResults, Converter= {StaticResource ResourceKey=RadioConverter}}"></RadioButton> <RadioButton Name="radFvsAccess" GroupName="fvsStorage" Content="Access" Grid.Column="2" Margin="11,0,0,0" IsChecked="{Binding Path=RadFvsResults, Converter= {StaticResource ResourceKey=InverseRadioConverter}}"></RadioButton>
Parts of RadioHelper.cs
public class RadioHelper:IValueConverter { public bool Inverse { get; set; } public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value != null) { bool boolValue = (bool)value; return this.Inverse ? !boolValue : boolValue; } return Binding.DoNothing; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { bool boolValue = (bool)value; if (!boolValue) { return Binding.DoNothing; } return !this.Inverse; } }
Friday, August 12, 2016
Random Forest Regression, Negative Variance Explained mechanism
Jeffery Evans, Senior Landscape Ecologist, The Nature Conservancy, Global Lands Science Team, Affiliate Assistant Professor, Zoology & Physiology, University of Wyoming explains a negative percent variance explained in a random forest regression in hilarious way -
I
have recently been asked the question: “why do I receive a negative percent
variance explained in a random forest regression”. Besides the obvious answer
“because your model is crap” I thought that I would explain the mechanism at
work here so the assumption is not that randomForests is producing erroneous
results. For poorly supported models it is, in fact, possible to receive a
negative percent variance explained.
Generally,
explained variance (R²) is defined as:
R²
= 1 - sum((Å·-mean(y))²) / sum((mean(y)-y)²)
However,
as indicated by Breiman (2001) and the R randomForest documentation the
(regression only) “pseudo R-squared” is derived as:
R²
= 1 – (mean squared error) / var(y)
Which,
mathematically can produce negative values. A simple interpretation of a
negative R² (rsq), is that you are better off predicting any given sample as
equal to overall estimated mean, indicating very poor model performance.
Multi-item Selection WPF ListBox using Attached Property
The attached property class looks like -
ListBoxHelper.cs
1: public static class ListBoxHelper
2: {
3: public static readonly DependencyProperty SelectedItemsProperty =
4: DependencyProperty.RegisterAttached("SelectedItems",
5: typeof(IList),
6: typeof(ListBoxHelper),
7: new PropertyMetadata(default(List<string>),
8: OnSelectedItemsChanged));
9:
10: public static IList GetSelectedItems(DependencyObject d)
11: {
12: return (IList)d.GetValue(SelectedItemsProperty);
13: }
14:
15: public static void SetSelectedItems(DependencyObject d, IList value)
16: {
17: d.SetValue(SelectedItemsProperty,value);
18: }
19:
20: private static void OnSelectedItemsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
21: {
22: var listBox = (ListBox)d;
23: ReSetSelectedItems(listBox);
24: listBox.SelectionChanged += delegate
25: {
26: ReSetSelectedItems(listBox);
27: };
28: }
29:
30: private static void ReSetSelectedItems(ListBox listBox)
31: {
32: IList selectedItems = GetSelectedItems(listBox);
33: selectedItems.Clear();
34: if (listBox.SelectedItems != null)
35: {
36: foreach (var item in listBox.SelectedItems)
37: selectedItems.Add(item.ToString());
38: }
39: }
40: }
Databind between View and ViewModel for PasswordBox WPF
"When you try to databind the password property of a PasswordBox you will recognize that you cannot do data binding on it. The reason for this is, that the password property is not backed by a DependencyProperty.
The reason is databinding passwords is not a good design for security reasons and should be avoided. But sometimes this security is not necessary, then it's only cumbersome that you cannot bind to the password property. In this special cases you can take advantage of the following PasswortBoxHelper.
The PasswordHelper is attached to the password box by calling the PasswordHelper.Attach property. The attached property PasswordHelper.Password provides a bindable copy of the original password property of the PasswordBox control."
Published on -
PasswordHelper.cs
1: public static class PasswordHelper
2: {
3: public static readonly DependencyProperty PasswordProperty =
4: DependencyProperty.RegisterAttached("Password",
5: typeof(string), typeof(PasswordHelper),
6: new FrameworkPropertyMetadata(string.Empty, OnPasswordPropertyChanged));
7:
8: public static readonly DependencyProperty AttachProperty =
9: DependencyProperty.RegisterAttached("Attach",
10: typeof(bool), typeof(PasswordHelper), new PropertyMetadata(false, Attach));
11:
12: private static readonly DependencyProperty IsUpdatingProperty =
13: DependencyProperty.RegisterAttached("IsUpdating", typeof(bool),
14: typeof(PasswordHelper));
15:
16:
17: public static void SetAttach(DependencyObject dp, bool value)
18: {
19: dp.SetValue(AttachProperty, value);
20: }
21:
22: public static bool GetAttach(DependencyObject dp)
23: {
24: return (bool)dp.GetValue(AttachProperty);
25: }
26:
27: public static string GetPassword(DependencyObject dp)
28: {
29: return (string)dp.GetValue(PasswordProperty);
30: }
31:
Tuesday, June 28, 2016
Interactive KML Placemarks using HTML/JavaScript
My colleague stopped by this morning and asked me to see if there is any way to implement combo box / drop-down list in KML file for dynamically selecting the Placemarks' information. Few hour of googling come up with a quick and dirty KML (adding custom data) using HTML/JavaScript in <ExtendedData> tag with combo box selection and pasted it here for our future reference. It may helps others as well. If there are any alternatives feel free to chime in.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Style id="MyBalloonStyle">
<BalloonStyle>
<text> <![CDATA[
<b>Example extended data template</b>
<div style="width:350px;" id="tree"></div>
<table id="table" border="1" >
<tr><td>Company Name</td></tr>
<tr><td><i>$[Company_Name]</i></td></tr>
<tr><td>
<select id = "treeListSelection" onchange = 'treeListChanged(value)'>
<option>--Select--</option>
<option value="tree 1">'Tree 1'</option>
<option value="tree 2">'Tree 2'</option>
</select>
</td></tr>
</table>
<script type="text/javascript">
function treeListChanged(value){
document.getElementById('tree').innerHTML = value ;
}
</script>
]]></text>
<bgColor>ffffffbb</bgColor>
</BalloonStyle>
<IconStyle> <color>ffffffff</color> <scale>1</scale>
<Icon><href>http://maps.google.com/mapfiles/kml/pushpin/grn-pushpin.png</href>
</Icon>
</IconStyle>
<LabelStyle>
<scale>0</scale>
</LabelStyle>
</Style>
Monday, June 27, 2016
[SOLUTION] Vagrant - Remote connection disconnect. Retrying ...
Here is error from guest machine, complaining about remote connection
==> default: Attempting graceful shutdown of VM...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 (guest) => 8080 (host) (adapter 1)
default: 3000 (guest) => 3000 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
[SOLUTION] Vagrant box authentication failure after packaging box
ERROR IN NEWLY PACKAGED BOX AFTER - vagrant up
SOLUTION
1. Press CTRL + Z to break the 'default: Warning: Authentication failure. Retrying... or wait for few more minutes
2. Login into your guest machine - vagrant ssh , which should prompt you for password, vagrant , the default password for vagrant
3. Then go to - /home/vagrant/.ssh and remote all the contents inside it, if the path not existed create the directory - mkdir -p /home/vagrant/.ssh
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
SOLUTION
1. Press CTRL + Z to break the 'default: Warning: Authentication failure. Retrying... or wait for few more minutes
2. Login into your guest machine - vagrant ssh , which should prompt you for password, vagrant , the default password for vagrant
3. Then go to - /home/vagrant/.ssh and remote all the contents inside it, if the path not existed create the directory - mkdir -p /home/vagrant/.ssh
Tuesday, May 31, 2016
Code Snippet: Set default database schema in Nhibernate SessionFactory
1: //Setup oracle database connection and connection pool 2: public class OracleConnectionManager 3: { 4: private static string _userName; 5: private static string _password; 6: 7: public OracleConnectionManager(string userName, string password) 8: { 9: _userName = userName; 10: _password = password; 11: } 12: 13: private static ISessionFactory _sessionFactory; 14: private static ISessionFactory SessionFactory { get 15: { 16: if(_sessionFactory == null) 17: { 18: var connectionString = DatabaseConnections.GetOracleConnectionsString(_userName,_password); 19: 20: //Nhibernate Oracle database configuration 21: var configuration = new Configuration(); 22: configuration.DataBaseIntegration(db => 23: { 24: db.ConnectionProvider<NHibernate.Connection.DriverConnectionProvider>(); 25: db.Dialect<NHibernate.Dialect.Oracle10gDialect>(); 26: db.Driver<NHibernate.Driver.OracleDataClientDriver>(); 27: db.ConnectionString = connectionString; 28: }); 29: 30:
// Setup default schema 31: configuration.SetProperty(Environment.DefaultSchema, "DB_SCHEMA_NAME");
Monday, May 30, 2016
Open Source Cloud GIS System Setup with Amazon EC2 and Geoserver
Follow these steps to set up the open source cloud based GIS mapping system.
1. Create an Amazon Web Services (AWS) account. You can find instructions for this step in the EC2 Getting Started Guide.
3. Create an Amazon EC2 instance. Instructions are also in the EC2 Getting Started Guide. When choosing an AMI make sure you choose a Windows server with IIS (and ASP.NET) already installed.
4. Connect to your Windows EC2 instance and install GeoServer. You can download GeoServer here. There are multiple setups available. Use the Windows installer. The instructions for the install are here.
5. Copy GIS data and configure map layers. The GeoServer user's manual will guide you through the steps of configuring GeoServer.
6. Start GeoServer on the EC2 instance server.
7. Seed the layers in GeoWebCache on the server. Instructions for this are here. Note that jpeg tiles are smaller than png and the default for base layers. Also png are better quality and will always be used for overlays because they can be transparent and overlays need to support transparency. Seed all layers for zoom levels 0 to 10 for EPSG:4326. If it is a base layer, seed it with jpeg files. If it is an overlay layer, seed it with png files.
1. Create an Amazon Web Services (AWS) account. You can find instructions for this step in the EC2 Getting Started Guide.
3. Create an Amazon EC2 instance. Instructions are also in the EC2 Getting Started Guide. When choosing an AMI make sure you choose a Windows server with IIS (and ASP.NET) already installed.
4. Connect to your Windows EC2 instance and install GeoServer. You can download GeoServer here. There are multiple setups available. Use the Windows installer. The instructions for the install are here.
5. Copy GIS data and configure map layers. The GeoServer user's manual will guide you through the steps of configuring GeoServer.
6. Start GeoServer on the EC2 instance server.
7. Seed the layers in GeoWebCache on the server. Instructions for this are here. Note that jpeg tiles are smaller than png and the default for base layers. Also png are better quality and will always be used for overlays because they can be transparent and overlays need to support transparency. Seed all layers for zoom levels 0 to 10 for EPSG:4326. If it is a base layer, seed it with jpeg files. If it is an overlay layer, seed it with png files.
Thursday, May 26, 2016
Setting up automatic product or build version increment using JENKINS for .NET projects
Steps for setting up automatic product or build version increment using JENKINS Continious Integration server and Visual Studio for .NET projects
Part A - Configure Visual Studio Solution
1. Copy the "AssemblyInfo.cs" from your project solutions and rename into "AssemblyInfo.cs.template"
2. Add a file called "AssemblyInfo.cs.template" and replace with these two lines:
Part A - Configure Visual Studio Solution
1. Copy the "AssemblyInfo.cs" from your project solutions and rename into "AssemblyInfo.cs.template"
2. Add a file called "AssemblyInfo.cs.template" and replace with these two lines:
[assembly:
AssemblyVersion("#VERSION_NUMBER#")]
[assembly:
AssemblyFileVersion("#VERSION_NUMBER#")]
3. In project properties, insert this pre-build command:
"$(SolutionDir)builder-scripts\templates\pre-build\Stamper.exe"
"$(ProjectDir)\"
4. Put the "builder-scripts" folder into your solution
folder. Builder scripts source
Code snippet: Unzip the zip file in C# using DotNetZip
DotNetZip is a FAST, FREE class library and toolset for manipulating zip files. Use VB, C# or any .NET language to easily create, extract, or update zip files.
1: public static void DeCompressFile(string zipFilePath, string extractPath)
2: {
3: string zipToUnpack = zipFilePath;
4: string unpackDirectory = extractPath;
5: using (ZipFile zipfiles = ZipFile.Read(zipToUnpack))
6: {
7: // Here, we extract every entry, but we could extract conditionally based on entry name, size, date, checkbox status, etc.
8: foreach (ZipEntry e in zipfiles)
9: {
10: e.Extract(unpackDirectory, ExtractExistingFileAction.OverwriteSilently);
11: }
12: }
13:
14: Console.WriteLine("Status: Done extracting the zipped Archive");
15: }
Code snippet: Read data from Access Database in C#
Read data from Access Database in C#
1: private static void ReadFromAccess(string accessDbPath)
2: {
3: string connection = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source= {0}",accessDbPath);
4: using (OleDbConnection con = new OleDbConnection(connection))
5: {
6: try
7: { con.Open();
8: OleDbCommand cmd = new OleDbCommand("SELECT * FROM Table_NAME", con);
9: OleDbDataReader reader = cmd.ExecuteReader();
10:
11: while (reader.Read())
12: {
13: Console.WriteLine(reader.GetString(0));
14: }
15:
16: }catch(Exception ex)
17: {
18: Console.WriteLine(ex.Message);
19: }finally
20: {
21: con.Close();
22: }
23: }
24: }
Thursday, March 3, 2016
Esri Leaflet Dynamic TileLayer Plugin Example
While working in one my Esri-Leaflet based application, I am stumbled on rendering dynamic map layers on tiled basis. Esri leaflet-api does the perfect job on non-tiled layer display but L.esri.DynamicMapLayer, doesn’t provide the tiled dynamic map layers. Looking around I came across the Tiled dynamic layer plugin for esri-leaflet, for displaying the DynamicMapLayer in tiled mode.
Here I have created both non-tiled and tiled DynamicMapLayer version for comparison using plain esri-leaflet and esri-leaflet with plugin.
Here I have created both non-tiled and tiled DynamicMapLayer version for comparison using plain esri-leaflet and esri-leaflet with plugin.
Gallery: Animated Dendrograms using D3.js
Lists of animated dendrograms using D3.js
1) Dendrogram with root to node selected path highlight, zoom and pan
2) Species sunburst
3) Species wheel with zoom pan feature
4) Collapsible dendrogram with root to node selected path highlight plus zoom/pan
How to display HTML5 applications from Github Gist to bl.ocks.org?
The http://bl.ocks.org is a simple viewer for HTML/CSS/JavaScript code examples hosted on Github Gist, which is built by Mike Bostock. In other words, blocks.org is a tool which will convert the Gist code into the format you see in bl.okcs.org allowing you to view HTML/ CSS / JavaScript applications directly from GitHub/Gist. GitHub is a web based version control and source code repository and Gists are a great way to share your source code among the peers.
Gists could be anything, but in HTML/JavaScript perspective, it could be a beautiful visualization using d3.js, interactive web map using Leaflet or Openlayers or ESRI Javascript API, and web map with WMS layers etc. Gists can share single files, parts of files, or full applications.
If you have built a beautiful visualization using HTML/JavaScript and want to view on blocks.org.
Here is how to do this.
Wednesday, January 6, 2016
Conference: MidAmerica GIS Symposium (MAGIC) 2016 Symposium
The 2016 Symposium will be held at the Overland Park, KS Convention Center April 24 - April 28, 2016 in Overland Park, Kansas. The conference hotel, the Overland Park Sheraton is adjacent to the Convention Center.
Why did we chose Overland Park? Overland Park is one of the fastest growing areas in the country. The OP Convention Center is very spacious - offering our Planning Committees ample opportunity to bring you new learning experiences! Additionally, we've listened to your concerns with previous location logistics:
- Parking: It's free and there is plenty of it!
- Internet: It's also free EVERYWHERE including the guest rooms, meeting rooms, and Exhibit Hall!
- The Gym: It's free too!
- Location: Downtown Kansas City can be intimidating. The Overland Park Convention Center is extremely easy to get to, and is right off a major highway. Additionally, the area is hopping with new entertainment and shopping districts, restaurants and museums!
GIS covers such a broad range of subjects, applications and types of people that use it, that developing a conference program that meets everyone's needs is a challenging task. Even more challenging is an attendee trying to figure out exactly which sessions or topics will be most interesting and helpful. MAGIC 2016 is intended to focus the content of the presentation options into a program specifically geared to each attendee's needs.
Subscribe to:
Posts
(
Atom
)