More

Should I start a new project using the Silverlight API?

Should I start a new project using the Silverlight API?


I'm about to start a new mapping project for a client, and am considering using the ArcGIS Server Silverlight API, since it gives a lot of the required functionality out-of-the-box (especially with the Silverlight Viewer).

A colleague suggested this is a bad idea, since "Silverlight is dead technology". He says that most new internal Microsoft projects are moving to HTML5 instead of Silverlight.

This is a small project so I don't have the luxury of developing everything from scratch, which the JavaScript API entails. Using the Silverlight Viewer I can have the core functionality running almost immediately.

Does anyone have any opinions/inside information on whether Silverlight is a good idea for a new ArcGIS Server website?


Have you not heard? HTML6 is the latest greatest thing. Why arent you developing in that?
- Moral here is its like buying a new computer. You can always wait for the next best thing, but theres always something better around the corner. (see comments in that post as well).

I also like James Fee summary of Q&A question for UC2011, which is kind of related:

Q: How is Esri planning to support HTML5? A: I love the answer, basically HTML5 is awesome, but they realize that most of their user base is stuck on old versions of IE. Thus as awesome as it can be, it isn't.

IMO, the safest and most futureproof option will be Javascript, later tapping into HTML5 where need be.

You have not mentioned your requirements so I am not sure why you think you will have to do so much more work with Javascript.
Can you not leverage frameworks like Dojo/ExtJS to do the heavy lifting?
These frameworks compliment Javascript to match Silverlight, no?

I am a Flex fan myself, but have dabbled with Silverlight and like it.

Your application will need a makeover in a few years anyhow - if you can code in it, shoot for Silverlight!


I am not at all convinced that Silverlight is dead. Yes, MS talked about HTML5 and javascript and NOT SL in their windows 8 preview but in reality for LOB apps I think Silverlight provides what the other technologies can not. But maybe thats just me.

Some other facts- there is the rumour that there is an agreement between Apple and MS for Apple to support SL on iPhones and iPads. SL IS the development platform for windows 7 phone. Nokia will be shipping their phones with Windows 7 only. Smartphones (they say) is (or will be) the new PC. Large companies like SAP have moved part of their apps to Silverlight. Maybe its just me, but to me all these sound like SL is a long way away of being pronounced dead.


The rumors about Silverlight's premature death have already been thoroughly addressed and debunked.

Here is an article about support for XAML (the language used to provide the front-end for Silverlight applications) in Windows 8:

http://davidburela.wordpress.com/2011/06/14/premature-cries-of-silverlight-wpf-skill-loss-windows-8-supports-all-programming-models/

Quoting:

I'm more excited about the new possibilities coming in the new Jupiter XAML programming model than the misconception that HTML+JS is the only way to create apps.

Here is some further information about current job growth in Silverlight positions:

https://softwareengineering.stackexchange.com/questions/15857/did-microsoft-kill-silverlight/75841#75841

As far as your question about starting a project with the ArcGIS API for Silverlight, it is worth noting that this is an award winning API which has been around for more than 2 years and receives significant support from ESRI.

As an alternative to learning the API, the ArcGIS Viewer for Silverlight provides a good out-of-the-box solution to create a map viewer without writing any source code.


Should we choose Java over C# for a new project? [duplicate]

We have a team of .NET developers (C#) with a range of experience from 2 to 6 years. Over the last few years we have been developing Silverlight, ASP.NET MVC, and WPF applications. However, there is a new two year project which means we will develop a HTML5 application on Linux.

The company I work for would like all developers across their offices to use the same programming language which is Java. Although there is talk of using Mono but using the same language and sharing modules, services, etc. already created in Java is the main reason for moving to Java.

Some of the developers here are upset. How do I find something positive in moving over that will convince the other developers?

There will be a training budget, but the thought of learning to work with Java libraries and a new platform (Linux) will be scaring a lot of the guys.


Hopefully your application is using MVVM pattern so that it can manufacture Blend data. I believe this is the recommended approach. If you are unfamiliar with it, definately take some time to get familiar with it.

I've inlcuded some code snippets below, but don't fret about the code too much, just follow the pattern.

Set up MMVM in your project and in the View Model constructor, check to see if you are in Blend. Pass in an agent that will handle getting the data for you.

We have an interface to populate the view, called IUserAgent, and two implementations, one for a service call and then one for the design time (fake data):

Then we have two implementation classes, one that gets data from the service:

And another that manufacturers data for the designer:

Each implementation returns back the same type of DTOs, for designer the data is manufactured:

Now, you can hand off your applicate to Blend and it will populate with data without using a WCF service call so that UI can be designed and rendered with data.


Checking Errors in Your Browser

The Maps JavaScript API writes error messages to window.console . This section explains how you can check the window.console output in Google Chrome. If you are using any other browsers, please check the developer documentation for your browser. For your reference, this is a list of tools to check window.console output in some other browsers.

In Chrome, you can use the JavaScript Console to check window.console output as follows.

  1. To open the Developer Tools, select the menu icon > More Tools > Developer Tools.
  2. To open the JavaScript Console, press the ESC key on your keyboard. The ESC key will toggle the JavaScript Console. If you close the console, press the ESC key again to open it.

If any errors or warnings occurred when loading the Maps JavaScript API, they appear as one or more lines in the console. An error or warning message has the following format:

Google Maps API error: [ERROR CODE] [Link to API document]
or
Google Maps API warning: [ERROR CODE] [Link to API document]

You can check the error codes table above to find the error code in the error message. You can also find the details about the error message in the API document linked from the message.

Note: You can listen for authentication errors programmatically.


What Should I Do For My GIS Project?

by JosephKerski

Many of us have encountered the following question from students: “What should I do for my GIS project?” Or, perhaps you are that student looking for a GIS project. While the best project is the one that students come up with themselves, sometimes, suggestions are helpful to get started. Below and in this video are some that I have provided to GIS students at many times in the past.

I always encourage the student to discuss his or her thoughts with me or their peers rather than me providing a simple list. I encourage students to start with issues that they are most passionate about. Don't pick something where you can easily find data, or even something your professor is interested in. pick something that you are interested in. For more from the student perspective, see my essay here.

The United Nations Millennium Development Goals provide a good framework and starting point, because these goals that address poverty, health, education, and others can all benefit by the spatial perspective and spatial analysis through GIS (http://www.un.org/millenniumgoals/). The UN Sustainable Development Goals provide a related excellent framework.

Along these lines are the issues raised by books in particular fields, such as my own book Essentials of the Environment. In this book I discuss biofuels, ecotones (the 'boundaries' of ecoregions), climate and weather, natural hazards, water quality and quantity, soil erosion, and other topics from local to global, and issues on the technical and instructional side, such as comparing field data collection methods. Another rich source of ideas is the annual Esri Map Books. Each entry in this book features a problem solved through the application of GIS—anchored in hundreds of disciplines from agriculture to zoology. The Esri industry pages (http://www.esri.com/industries), is another good source, giving a sense of the fields in which GIS is used details and case studies told through written stories and videos.

Still stuck? Try the following suggestions:

  1. Scan the recent User Conference proceedings from Esri (https://proceedings.esri.com/library/userconf/index.html), from www.scgis.org, and conferences from other organizations to gain ideas on the problems people are addressing, the data used, and the methods employed.
  2. Go through the Esri ArcGIS Book (https://learn.arcgis.com/en/arcgis-book/) for additional ideas that may spring forth from your investigation of the many intriguing maps there.
  3. Go through some articles on https://scholar.google.com/ using a variety of search terms.

I encourage students to read scholarly and trade journals, and to skim GIS blogs, Facebook pages (such as the Esri Higher Education group), and investigate ideas on GIS web news services such as Directions Magazine, GIS User, GIS Café, www.esri.com/news, and others. I encourage students to read local, regional, national, and international news to get a sense of issues of critical importance. In my local community, the top issues at the moment are deciding which schools to close in the wake of budget shortfalls, and mitigating and dealing with the aftermath of recent wildfires in the mountain foothills. In my state of Colorado, top issues include pine beetle infestation, designing urban greenways, extracting natural gas and oil shale, and an issue that has been with us for 150 years—water quality and availability. Just look around you. Current events from health, political instability, and natural disasters, to economic inequality, energy, water, and many more are valid foundations upon which to build GIS projects.

How do you respond to the question “what should do for my GIS project?” Some of my best ideas come from when I am out in the field, such as here in Utah.


API Status Codes

Status codes are returned with every request that is made to a web server. Status codes indicate information about what happened with a request. Here are some codes that are relevant to GET requests:

  • 200 : Everything went okay, and the result has been returned (if any).
  • 301 : The server is redirecting you to a different endpoint. This can happen when a company switches domain names, or an endpoint name is changed.
  • 400 : The server thinks you made a bad request. This can happen when you don’t send along the right data, among other things.
  • 401 : The server thinks you’re not authenticated. Many APIs require login ccredentials, so this happens when you don’t send the right credentials to access an API.
  • 403 : The resource you’re trying to access is forbidden: you don’t have the right permissions to see it.
  • 404 : The resource you tried to access wasn’t found on the server.
  • 503 : The server is not ready to handle the request.

You might notice that all of the status codes that begin with a ‘4’ indicate some sort of error. The first number of status codes indicate their categorization. This is useful — you can know that if your status code starts with a ‘2’ it was successful and if it starts with a ‘4’ or ‘5’ there was an error. If you’re interested you can read more about status codes here.


Use the Five-Step GIS Analysis Process

by Suzanne-Boden

This post shows how to apply a five-step process to complete an analysis project using ArcMap (the same analysis could be performed just as easily in ArcGIS Pro). Suppose you want to analyze access to health care services in Riverside and San Bernardino counties in southern California.

The five steps in the analysis process are:

Step 1. Frame the Question
This step seems straightforward because typically you're assigned a project to obtain specific information. Some projects involve answering several questions derived from a high-level question. How you frame the questions helps determine which GIS tools and methods you use for the analysis.

In this example, you might frame a preliminary high-level question: Is the distribution of health care facilities consistent with the population distribution in Riverside-San Bernardino, CA? This question could be broken down into the following sub-questions:

Step 2. Explore and Prepare Data
This step can be the most time-consuming. If you don't have all the data needed for an analysis project, you must collect it. The ArcGIS Living Atlas of the World is an excellent source of high-quality spatial data. In the U.S., the Census Bureau has a multitude of spatial, population, and demographic data. State data clearinghouses are another useful resource.

Step 2a: Explore Data
For each dataset, explore the feature geography, attributes, and metadata to determine whether the data will be useful for your analysis and what kind of preparation, if any, may be required. Questions to ask about the data include:

For this example, the following datasets were used. All use the WGS 1984 geographic coordinate system.

Step 2b: Prepare Data
To start, you need to decide what data format to use. Project data doesn't have to be all in the same format, but it can make things easier. The important thing is to verify that the analysis tools you need to use accept your data format also consider whether you will be distributing the data created by the analysis. You can use the geoprocessing tools in the ArcToolbox Conversion Tools toolbox to quickly convert data to another format. If you have access to the ArcGIS Data Interoperability extension, you can directly work with many data formats.

Organizing data into a project folder helps simplify analysis tasks (you can specify a default input workspace for all the geoprocessing tools).

If you are working with feature classes stored in different geodatabases, you could copy or import them into a single file-based project geodatabase. You might also want to create separate folders or geodatabases to store intermediate (temporary) data output from analysis operations as well as final data.

Extracting data to have the same extent as the study area helps speed up processing time and enhances data visualization in ArcMap. In this example, the project datasets cover the entire U.S.

In order to clip the data, you can create a selection layer of just Riverside and San Bernardino counties, or just select the two counties on the map. If you plan to use the same study area for multiple analysis projects, it's a good idea to export selected features and selection layers to their own shapefile or geodatabase feature class. That way, you have your study area feature data ready to go. For this example, we will simply select the two counties of interest.

Here's are the data preparation tasks for this project:

Repeat the steps to clip the hospitals.

When the clip operation completes, a layer representing hospitals within the study area is added to the Table of Contents.

The data preparation tasks are now complete.

Step 3. Choose Analysis Methods and Tools

To choose the appropriate methods and tools for an analysis project, consider the questions framed in step 1 and document the methods and tools that will answer each one.

Question Methods and Tools
Where are facilities that provide health care services located?Examine distribution of hospitals on the map.
What is the population distribution within the study area?Symbolize ZIP Codes layer based on population density using graduated colors.
Do areas with the highest population density have the greatest number of facilities?First, do a visual analysis of the map to get a general idea, then do a spatial join operation between the Hospitals and ZIP Codes. The output of the spatial join will be one record for each hospital and the ZIP Code attributes.
Within the study area, are there areas with high population but no health care facilities?Summarize the ZIP field in the table output from the spatial join. The summary table will include a count of hospitals in each ZIP code that contains a hospital, plus population data for each ZIP Code.

It's helpful at this step to diagram the analysis. The diagram doesn't have to be anything fancy (although it can be if you like that sort of thing). An easy thing is to quickly draw on paper or a whiteboard like the example below.

Step 4. Perform the Analysis
If you've diagrammed the process in step 3, then in this step, you simply follow the diagram, completing each task in sequence. For complicated analyses, you may want to create a model in ModelBuilder to automate the process. A model also allows you to quickly change a parameter and run the model again to explore different scenarios.

  • Examine the distribution of the hospital features on the map. Zoom and pan around as needed.
  • Symbolize ZIP Codes with graduated colors based on the POP07_SQMI (2007 population density) attribute.

A visual analysis of the data shows the greatest number of hospitals and the most densely populated ZIP Codes (in darker shades of green on the map below) are in the southwestern part of the study area.

You can get more information by doing a spatial join between the Hospitals and ZIP Codes layers.

  • Right-click Hospitals and click Joins and Relates > Join.
  • In the dialog box, choose to join data from another layer based on spatial location.
  • Choose ZIP Codes in the drop-down list of layers, specify the output feature class name and location, and click OK.

The output of the spatial join is a new point layer that contains all the hospital features plus the attributes of the ZIP Code each facility falls within. The ZIP field contains the five-digit ZIP Code in which the hospital is located, and the PO_NAME field contains the post office name (corresponds to the city name) for that ZIP Code. The POP07_SQMI field shows the population density associated with each hospital's ZIP Code.

Sorting the PO_NAME field reveals that multiple hospitals are located in some ZIP Codes.

The last step is to summarize the ZIP field. This operation will output a table that contains one record for each ZIP Code that contains a hospital, plus a field containing the count of hospitals within each ZIP Code. You can also choose to output statistics for numeric fields (such as POP07_SQMI).

  • In the joined table, right-click the ZIP field and choose Summarize.
  • For summary statistics, check First and Last for NAME (this is the hospital name) and check Average for both POP2007 (total population) and POP07_SQMI.
  • Specify an output location and name, then click OK.
  • Choose to add the result table to the map and open it.

Step 5. Examine and Refine Results

So what information does the summary table provide?

The Count_ZIP field tells you the number of hospitals in each ZIP Code that contains a hospital.

Sorting the POP07_SQMI field reveals that all the ZIP Codes that have more than 2,000 people per square mile have at least one health care facility.

The analysis shows that the distribution of health care services is generally consistent with the distribution of the population within the study area—that is the most facilities are located where the population is most dense. You could refine this analysis by considering the number of patients each facility can serve and other variables of interest. You could also extend the project to analyze whether access to health care services in the low-population areas is adequate. The current map indicates that residents of ZIP Codes with a low population density may have to travel a great distance to reach a hospital.

Want to learn more about performing analysis in ArcGIS? Check out these training options:


3 Answers 3

Is there any easy step-by-step reference to MVVM?

Is MVVM a super-set or a sub-set of MVC?

MVVM belongs to the MVC family, so, if you can say that at all, it's a subset. It's a variant to decouple the UI from the business logic underneath. I'd describe it as a sibling of MVC. Since the early days of OOP people have been searching for ways to decouple the UI from their logic. MVC was the first archetype that evolved. It is pretty simple, although most people do not get it right. The view is just an observer to the model and calls it when necessary. The controller is just a strategy for the view to communicate with the model, for example when you need an exchangeable behaviour (i.e. ReadonlyController, AdminController). MVC is very successfull and it's really a good practice to apply it.

MVVM is a specialized kind of MVP Pattern, as described by Martin Fowler. MVP tries to keep the view as dumb as possible (while still taking user input etc.), thus enhancing the testability. It aims for an abstraction of the view and the interaction-logic which is to put in the presenter. The presenter solely communicates with the model/business logic and updates the View. Martin Fowler describes MVVM pretty much in his Presentation Model Pattern.

The view is completely abstracted into a ViewModel. When the View needs a property, the ViewModel needs to have it as well. It (the ViewModel) is meant to be completely independent of underlying UI-technology, an abstraction. In order to communicate between View and ViewModel, a synchronization pattern needs to be used (i.e. Observer). This is not easy to accomplish in a stateless web environment. MVVM differs from MVP, as the View does not bind to your model/business logic anymore but to a ViewModel instead.

Which pattern is modern and which one should I choose for Windows & Web versions of my application?


Run, debug, and make changes

Choose the IIS Express button in the IDE to build and run the app in Debug mode. (Alternatively, press F5, or choose Debug > Start Debugging from the menu bar.)

If you get an error message that says Unable to connect to web server 'IIS Express', close Visual Studio and then open it by using the Run as administrator option from the right-click or context menu. Then, run the application again.

You might also get a message that asks if you want to accept an IIS SSL Express certificate. To view the code in a web browser, choose Yes, and then choose Yes if you receive a follow-up security warning message.

Visual Studio launches a browser window. You should then see Home, About, and Contact pages in the menu bar. (If you don't, choose the "hamburger" menu item to view them.)

Choose About from the menu bar.

Among other things, the About page in the browser renders the text that is set in the About.cshtml file.

Return to Visual Studio, and then press Shift+F5 to stop Debug mode. This also closes the project in the browser window.

In Visual Studio, choose About.cshtml. Then, delete the word additional and in its place, add the words file and directory.

Choose About.cshtml.cs. Then, clean up the using directives at the top of the file by using the following shortcut:

Choose any of the grayed-out using directives and a Quick Actions light bulb will appear just below the caret or in the left margin. Choose the light bulb, and then choose Remove Unnecessary Usings.

Visual Studio deletes the unnecessary using directives from the file.

Next, in the OnGet() method, change the body to the following code:

Notice that two wavy underlines appear under Environment and String. The wavy underlines appear because these types aren't in scope.

Open the Error List toolbar to see the same errors listed there. (If you don't see the Error List toolbar, choose View > Error List from the top menu bar.)

Let's fix this. In the code editor, place your cursor on either line that contains the error, and then choose the Quick Actions light bulb in the left margin. Then, from the drop-down menu, choose using System to add this directive to the top of your file and resolve the errors.

Press Ctrl+S to save your changes, and then press F5 to open your project in the web browser.

At the top of the web site, choose About to view your changes.

Close the web browser, press Shift+F5 to stop Debug mode, and then close Visual Studio.


Using the REST APIs

The following topics describe how the Jira REST APIs are structured and how you can interact with them.

Expansion

To simplify API responses, the Jira REST API uses resource expansion. This means that the API will only return parts of the resource when explicitly requested. This helps you avoid problems that can occur when you request too little information (for example, you need to make many requests) or too much information (for example, performance impact on Jira).

You can use the expand query parameter to specify a comma-separated list of entities that you want expanded, identifying each of them by name. For example, appending ?expand=names,renderedFields to an issue's URI requests the inclusion of the translated field names and the HTML-rendered field values in the response.

The following example expands the name and renderedFields fields for issue JRA-9:

To find out which fields are expandable, look at the expand property in the parent object. In the following example, the widgets field is expandable:

You can use the dot notation to specify expansion of entities within another entity. For example, ?expand=widgets.fringels would expand the widgets collection and also the fringels property on each widget.

Pagination

Jira uses pagination to limit the response size for resources that return a potentially large collection of items. A request to a paged API will result in a values array wrapped in a JSON object with some paging metadata, for example:

  • startAt: – the item used as the first item in the page of results.
  • maxResults: – number of items to return per page.
  • total: – total number of items to return, subject to server-enforced limits. This number may change as the client requests the subsequent pages. A client should always assume that the requested page can be empty. REST API consumers should also consider the field to be optional. In cases when calculating this value is too expensive it may not be included in the response.
  • isLastPage: – indicates whether the current page returned is the last page of results.

Clients can use the startAt , maxResults , and total parameters to retrieve the desired number of results. Note that each API resource or method may have a different limit on the number of items returned, which means you can ask for more than you are given. The actual number of items returned is an implementation detail and this can be changed over time.

Ordering

Some resources support ordering by a specific field. This is provided by the orderBy query parameter.

Ordering can be ascending or descending. To specify the type of ordering, use the "+" or "-" symbols for ascending or descending respectively. By default, ordering is ascending. For example, ?orderBy=+name will order the results by name in ascending order.

Self links

Many fields have a self link that takes you to the canonical location for that resource. For example:

Making a GET request to the self link can sometimes provide you with additional information about the field. For example, if we make a GET request for the self link for the reporter field above, the response will contain additional information about the user, including the timezone and groups.

Special request and response headers

  • X-AUSERNAME – response header that contains either username of the authenticated user or ɺnonymous'.
  • X-Atlassian-Token – methods that accept multipart/form-data will only process requests with X-Atlassian-Token: no-check header.

Error responses

Most resources will return a response body in addition to the status code. Usually, the JSON schema of the entity returned is the following:

Field input formats

Summary: A system field that is a single line of text.

Description: A system field that is multiple lines of text.

Components: A system field that is multiple values addressed by 'name'.

Due date: A system field that is a date in 'YYYY-MM-DD' format.

Labels: A system field that is an array of string values.

Checkbox custom field: A custom field that allows you to select a multiple values from a defined list of values. You can address them by value or by ID .

Date picker custom field: A custom field that is a date in YYYY-MM-DD format.

Date time picker custom field: A custom field that is a date time in ISO 8601 YYYY-MM-DDThh:mm:ss.sTZD format.

Labels custom field: A custom field that is an array of strings.

Number custom field: A custom field that contains a number.

Radio button custom field: A custom field that allows you to select a single value from a defined list of values. You can address them by value or by ID .


Watch the video: How to Start a New Project in 5 Steps