ArcGIS for Server: Publishing and Using Map Services
Transcript of ArcGIS for Server: Publishing and Using Map Services
![Page 1: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/1.jpg)
ArcGIS for Server: Publishing and Using Map Services
Craig Williams & Tanu Hoque
Link to this presentation: http://bit.ly/1EA5dEI
![Page 2: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/2.jpg)
Agenda
• Platform overview• Publishing services
- Demo: Publishing hosted feature service
• Map services - Demo: layer IDs, dynamic layers, query statistics,
query layers
• Standardized queries with services• Questions
![Page 3: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/3.jpg)
The ArcGIS Platform
• Online / Portal• Desktop• Server• Apps• Developer• Solutions
Desktop Web Device
Server Online Content and Services
Online / Portal
![Page 4: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/4.jpg)
Publishing services
![Page 5: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/5.jpg)
Information Sharing is Critical
Transparency and easy information access are now expected…
Users
Search & Use
. . . Sharing With a Group,Organization, or the Open Web
![Page 6: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/6.jpg)
Sharing as Services
• Our goal: make it easier to share GIS resources- Unified sharing experience- Comprehensive analysis- Sharing to servers in the enterprise and to ArcGIS Online / Portal
Professional to Everyone
ArcGIS
![Page 7: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/7.jpg)
Sharing as Services
ArcGISOnline / Portal
ArcGIS Server On The Cloud
ArcGIS Server On-premises
Desktop
![Page 8: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/8.jpg)
Hosted feature services
Sharing Layers Online
![Page 9: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/9.jpg)
Hosted Mapping on ArcGIS Online
• Sharing the easy way- No Server to buy, install, or maintain- Scales automatically- No Firewall or IT issues
• Limitations- Only Tiled Map and Feature Services supported- Data is private to each service
ArcGIS
![Page 10: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/10.jpg)
ArcGIS Server in the Enterprise
• Recent improvements- Successful publishing of shared data- Comprehensive analysis- Simple publishing with copying of data
• When to use?- Need the full functionality of ArcGIS Server- Want full control over all hard and software- Want to publish services on live, shared data
![Page 11: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/11.jpg)
ArcGIS Server Data Stores
• Server has a list of registered Data Stores• Data Store is of type
- Enterprise Geodatabase- Folder
- Tip: register top-most folder level possible for maximal benefit
• Access to the Data Store is validated during registration - On all machines in the site
• Replicated data stores for separate data instances- Tip: Read Help Topic About registering your data with the server
Data Stores are a key concept for publishing to ArcGIS Server
![Page 12: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/12.jpg)
Service Definition (.sd)
• File format for publishing all services- For all services (Map, Geoprocessing, etc.)
• Contains everything required to create a service:- GIS resources (Map, Globe, etc.)
- embeddable fonts (if needed)- Service Configuration- Data (if it needs to be copied to the server)
• Uploaded to the server when publishing• Can be saved and published later
- Using Catalog or Server Manager
![Page 13: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/13.jpg)
Map Services
![Page 14: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/14.jpg)
Review of Map Services Since ArcGIS 10.1
• One unified map service- An updated optimized map service- Supports additional capabilities, data types, layers, renderers
• New extension capabilities: - Network Analysis
• Can be used to display Geoprocessing results
Application
ArcGIS Server
Map Server
http
![Page 15: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/15.jpg)
Preserve Layer/Table IDsQuery By DistanceQuery ReturnExtentPaginationDynamicLayersQuery to return statisticsQueryLayer
MapService Demos
![Page 16: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/16.jpg)
Map Services: New at 10.3x
![Page 17: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/17.jpg)
![Page 18: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/18.jpg)
Preserving Layer/Table IDsLayer/Table IDs do not change when map service is republished
Service directory
3
5
With immutable layers
Without immutable layers
Re-publish
• Introduced at 10.3• This ensures that Layer IDs are unique (as usual)• and preserves the IDs originally assigned
![Page 19: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/19.jpg)
Preserving Layer/Table IDsHow to enable?
In ArcMap, set Data Frame Properties …
In the Layer Properties you can assign your own ID if you like. ArcGIS will ensure it is unique.By default the option is unchecked
![Page 20: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/20.jpg)
Preserving Layer/Table IDsAnalyzer
• In the case of duplicate layer IDs, the analyzer will detect
![Page 21: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/21.jpg)
Preserving Layer/Table IDsThings to remember
• You can now add, remove, shuffle layers• Your layer IDs will remain and your apps won’t break
• You need to republish …
![Page 22: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/22.jpg)
![Page 23: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/23.jpg)
Pagination (ver 10.3)
• Check the layer/table resources to make sure it support pagination
• Two properties are added to the Query operation
![Page 24: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/24.jpg)
Pagination (JavaScript API for ArcGIS)• Two properties are added to the Query class
![Page 25: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/25.jpg)
• Supported data sources- Most enterprise databases e.g. SQL Server (ver 2012+), Oracle, PostgreSQL- QueryLayer
• FileGDBs support at 10.3.1• File based datasource e.g. Shape files do not support pagination
Pagination (ver 10.3)
![Page 26: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/26.jpg)
Query by Distance and ReturnExtents (ver 10.3.1)
• Check the layer/table resources to make sure it support pagination
• 3 properties are added to the Query operation
![Page 27: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/27.jpg)
Query by Distance (JavaScript API for ArcGIS)• Two properties are added to the Query class
![Page 28: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/28.jpg)
Query to ReturnExtents (JavaScript API for ArcGIS)
• New method and event in the QueryTask class
![Page 29: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/29.jpg)
How to enable dynamicLayer?Change layer’s rendererAdd new layerUse client side data with map serviceQuery layer
MapService: DynamicLayers
![Page 30: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/30.jpg)
Dynamic Layers: The Concept
• Capability with the map service that allows for per-request changes to the map- Optional capability of map services
• Allows for:- Updating renderers and symbols- Removing and reordering layers- Changing layer data sources- Adding new layers from registered data sources
![Page 31: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/31.jpg)
Dynamic Layers: Use Cases
• Simple updates to the map service- Remove layers or reorder layers
• Thematic mapping- Updates to renderers
• Adding content to the map service- Add data from registered workspaces
- Including query layers
• Add to the map on a per-request basis- ArcGIS APIs handle this for you
Application
Map Service
REST
Workspaces
http json
![Page 32: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/32.jpg)
Thematic Mapping
• Special case of dynamic layers supported via- Ability to change renderer- Ability to change data sources – including joins- Map service API for constructing renderer classes
• Generate renderer operation- Supports class breaks and unique value class generation- Popular classification types from ArcGIS for Desktop
![Page 33: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/33.jpg)
Thematic Mapping
• When do I use dynamic layers instead of feature layers on the client for thematic mapping?
- large number of features- complex geometries that cannot be generalized- when it provides a performance advantage
• Each approach has tradeoffs- e.g. Client side features scale better and provide more interactive behavior- Generate renderer can be used with both approaches
When to use?
![Page 34: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/34.jpg)
Enabling Dynamic Layers
![Page 35: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/35.jpg)
Dynamic Layers
• See the topic About dynamic layers in the ArcGIS Server help• REST API – See the Dynamic Layer / Table resource help
More Information
![Page 36: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/36.jpg)
OutStatisticsStandardizedQueries
MapService: Queries
![Page 37: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/37.jpg)
Getting aggregated values in a Query result in Map Services
• Support for order by, output statistics, and group by statistics was added for both layers / tables
- count | sum | min | max | avg | std dev | var
• Additional query capabilities- Optional ability to return M and Z values for features- Can query a specific geodatabase version- Query response contains a flag when maxRecordCount was reached by the query
![Page 38: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/38.jpg)
Database Agnostic Way to Query
• One SQL syntax runs against all databases!- e.g. one date query syntax --- YEAH!
- incident_time = date '3/16/2000 3:45:47 PM‘- upper(name) = ‘JOHN EDWARD’
• Based on SQL92 query syntax and functions- Does not accept any DB vendor specific queries- http://resources.arcgis.com/en/help/main/10.2/index.html#/Supported_SQL_functions_
in_ArcGIS_Server/015400000686000000/
• StandardizedQuery is turned on by default
Standardized Queries - Introduced at ArcGIS 10.2
![Page 39: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/39.jpg)
Database Agnostic Way to Query
• Limitations- Only a subset of functions available- Not supported for
- Joined table/layer from multiple workspaces or OLE DB tables
• Server level property- To switch back:- http://<server>/arcgis/admin/system/properties/update- {"standardizedQueries":"false"}
Standardized Queries - Introduced at ArcGIS 10.2
![Page 40: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/40.jpg)
Rate This Sessionwww.esri.com/RateMyDevSummitSession
![Page 41: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/41.jpg)
Questions?Link to this presentation: http://bit.ly/1EA5dEI
![Page 42: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/42.jpg)
Modify drawingInfo:Change layer’s rendererDefine layer’s labels
Add new layerUse client side data with map serviceQuery layer
Sample Code Appendix
![Page 43: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/43.jpg)
Sample code to Modify Drawing Info (Renderer and Labels)
![Page 44: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/44.jpg)
Dynamic Layers: Generate RendererREST request http://esriurl.com/5978
http://.../MapServer/2/generateRenderer?classificationDef = {
"type": "classBreaksDef","classificationField": "POP2007","classificationMethod": "esriClassifyQuantile","breakCount": 5,"colorRamp": {
"type": "algorithmic","fromColor": [255, 255, 255, 255],"toColor": [0, 0, 255, 255 ],"algorithm": "esriCIELabAlgorithm"
}}
![Page 45: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/45.jpg)
Dynamic Layers: Update RendererREST request http://esriurl.com/5979
http://.../Census/MapServer/export?....&dynamicLayers = [ {
"source": {"type": "mapLayer","mapLayerId": 0
},"drawingInfo": {
"renderer": {"type": "classBreaks","field": "POP2007","classBreakInfos": [ … ]
} } ]
![Page 46: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/46.jpg)
Dynamic Layers: Dynamic LabelingREST request http://esriurl.com/8900
http://.../Census/MapServer/export?....&dynamicLayers = [ {
"source": {"type": "mapLayer","mapLayerId": 2
},"drawingInfo": { ... },"showLabels": true,"labelingInfo": [ {
"labelExpression": "[POP2000]","labelPlacement": "esriServerPolygonPlacementAlwaysHorizontal","symbol": { ... } } ]
} ] Help on LabelExpression: htttp://esriurl.com/8903
![Page 47: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/47.jpg)
Dynamic Layers: Generate RendererJavaScript API code http://esriurl.com/5968
var generateRenderer = new esri.tasks.GenerateRendererTask("http://serv../cens/MapServer/2");
var params = new esri.tasks.GenerateRendererParameters();params.classificationDefinition = classDef;
generateRenderer.execute(params, applyRenderer, errorHandler)
1
2
3
![Page 48: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/48.jpg)
Dynamic Layers: Update RendererJavaScript API code http://esriurl.com/8901
generateRenderer.execute(params, applyRenderer, errorHandler);
function applyRenderer(renderer) {var drawingOptions = new esri.layers.LayerDrawingOptions();drawingOptions.renderer = renderer; optionsArray[2] = drawingOptions;usaLayer.setLayerDrawingOptions(optionsArray);usaLayer.show();
}
1
2
![Page 49: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/49.jpg)
Dynamic Layers: Dynamic LabelingJavaScript API code http://esriurl.com/8902
var drawingOptions = new LayerDrawingOptions();var labelClass = new LabelClass( {
labelExpression: ' "Name: " CONCAT [CNTY_FIPS] CONCAT NEWLINE CONCAT "Count: " CONCAT [POP2000] '});
labelClass.labelPlacement = "always-horizontal";labelClass.symbol = new TextSymbol( {font: new Font("12",
Font.STYLE_NORMAL,Font.VARIANT_NORMAL,Font.WEIGHT_BOLD,"Arial"),
color: new Color("#666633"),horizontalAlignment: "left" });
drawingOptions.labelingInfo = [labelClass];drawingOptions.showLabels = true;
![Page 50: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/50.jpg)
Sample code to Add New Layer
![Page 51: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/51.jpg)
Dynamic Layers: Add Layer from Registered WorkspaceREST request http://esriurl.com/5980
http://.../USA/MapServer/export?....&dynamicLayers = [ {
"id": 104,"source": {
"type": "dataLayer","dataSource": {
"type": "table","workspaceId": "MyDatabaseWorkspaceIDSSR2","dataSourceName": "ss6.gdb.Lakes"
}},"drawingInfo": {…}
} ]
![Page 52: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/52.jpg)
Dynamic Layers: Add Layer from Registered WorkspaceJavaScript API code http://esriurl.com/5974
var dynamicLayerInfos = usaLayer.createDynamicLayerInfosFromLayerInfos();
var dataSource = new esri.layers.TableDataSource();dataSource.workspaceId = "MyDatabaseWorkspaceIDSSR2";dataSource.dataSourceName = "egdb.DBADMIN.USLakes";var layerSource = new esri.layers.LayerDataSource();layerSource.dataSource = dataSource;
var dynamicLayerInfo = new esri.layers.DynamicLayerInfo();dynamicLayerInfo.source = layerSource;
dynamicLayerInfos.splice(0, 0, dynamicLayerInfo);usaLayer.setDynamicLayerInfos(dynamicLayerInfos);
1
2
3
4
![Page 53: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/53.jpg)
Sample code to Use Client Side DataBlog: http://esriurl.com/5993
![Page 54: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/54.jpg)
Dynamic Layers: Add Query LayerREST request http://esriurl.com/5982
http://.../USA/MapServer/export?....&dynamicLayers = [ {
"source": {"type": "dataLayer","dataSource": {
"type": "queryTable","workspaceId": "MyDatabaseWorkspaceIDSSR2","query": "SELECT * FROM ss6.gdb.Lakes","oidFields": "objectid","geometryType": "esriGeometryPolygon","spatialReference": { "wkid": 4326 }
} },"drawingInfo": {…} } ]
![Page 55: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/55.jpg)
Dynamic Layers: Add Query LayerJavaScript API code http://esriurl.com/5977
var dynamicLayerInfos = usaLayer.createDynamicLayerInfosFromLayerInfos();
var queryDataSource = new esri.layers.QueryDataSource();queryDataSource.workspaceId = "MyDatabaseWorkspaceIDSSR2";queryDataSource.query = "SELECT * FROM ss6.gdb.Lakes";queryDataSource.oidFields = ["objectid"] ;queryDataSource.geometryType = "polygon";queryDataSource.spatialReference = new esri.SpatialReference({wkid:4326});
layerSource.dataSource = queryDataSource;var dynamicLayerInfo = new esri.layers.DynamicLayerInfo();dynamicLayerInfo.source = layerSource;
dynamicLayerInfos.splice(0, 0, dynamicLayerInfo);usaLayer.setDynamicLayerInfos(dynamicLayerInfos);
1
2
3
4
![Page 56: ArcGIS for Server: Publishing and Using Map Services](https://reader037.fdocuments.in/reader037/viewer/2022102821/589d74b41a28abd1498b96bf/html5/thumbnails/56.jpg)
SQL Query to Compute Population Mean Center
select 1 as oid,geometry::Point(
sum(a.shape.STCentroid().STX * b.Yr_1930) / sum(b.Yr_1930), sum(a.shape.STCentroid().STY * b.Yr_1930) / sum(b.Yr_1930),
'102008') as shapefrom STATES as a
inner join USPOP1900TO2013 as b
on a.STATE_ABBR = b.STATE_ABBR
select 1 as oid,geometry::Point(
sum(a.shape.STCentroid().STX * b.Yr_1930) / sum(b.Yr_1930), sum(a.shape.STCentroid().STY * b.Yr_1930) / sum(b.Yr_1930),
'102008') as shapefrom STATES as a
inner join USPOP1900TO2013 as b
on a.STATE_ABBR = b.STATE_ABBR