Publish is the process of creating a new layer that is designed for high performance and availability for use in web applications, from a transactional layer. The publish process gives the application programmer a flexible way to create multiple layers, displaying different data from a single base layer. These layers can then be added to your application and kept current with subsequent publish calls which can be automated.
The layer definitions below create a new summary dataset that is aggregated by postal code and that includes average, max, min and sum values for the SALE_PRICE field. The result is then linked to the Postal Code data component from the SpatialStream® Content Library using PROP_ZIP as the key.
Two layer definitions are presented below. The first one contains a layer definition for the base data and the second one contains the layer definition for the published layer.
1: <?xml version="1.0" encoding="utf-8"?>
2: <Layer PublicName="DMP_LICENSE/LASALESDATAFORPUBLISH" Name="DMP_LICENSE/LASALESDATAFORPUBLISH" Type="WMS" StorageType="DB">
3: <Description>LA Sales Data 2010 for Publish Example</Description>
4: <GeometryType>POINT</GeometryType>
5: <IndexedFields Scope="private">PROP_ZIP,LANDUSE_DESC,SALE_PRICE,SALE_DATE</IndexedFields>
6: <Schema>
7: <ElementType name="Row">
8: <AttributeType name="LANDUSE_DESC" label="LANDUSE_DESC" abbrname="LANDUSE_DESC" editable="False" searchable="true" length="50">
9: <Datatype type="string" />
10: </AttributeType>
11: <AttributeType name="SALE_DATE" label="SALE_DATE" abbrname="SALE_DATE" editable="False" searchable="true">
12: <Datatype type="date" />
13: </AttributeType>
14: <AttributeType name="SALE_PRICE" label="SALE_PRICE" abbrname="SALE_PRICE" editable="False" searchable="true">
15: <Datatype type="integer" />
16: </AttributeType>
17: <AttributeType name="PROP_ZIP" label="PRICEPERSQFT" abbrname="PRICEPERSQFT" editable="true" searchable="true" length="10">
18: <Datatype type="string" />
19: </AttributeType>
20: <AttributeType name="LONGITUDE" label="LONGITUDE" abbrname="LONGITUDE" editable="true" searchable="true">
21: <Datatype type="double" />
22: </AttributeType>
23: <AttributeType name="LATITUDE" label="LATITUDE" abbrname="LATITUDE" editable="true" searchable="true">
24: <Datatype type="double" />
25: </AttributeType>
26: </ElementType>
27: </Schema>
28: </Layer>
1: <?xml version="1.0" encoding="utf-8"?>
2: <Layer Name="DMP_LICENSE/LAAVERAGEPRICESOLD" StorageType="DOFS" PublicName="DMP_LICENSE/LAAVERAGEPRICESOLD">
3: <BaseResource Name="S">DMP_LICENSE/LASALESDATAFORPUBLISH</BaseResource>
4: <Description>La Sales Data Example</Description>
5: <IndexedFields>PROP_ZIP</IndexedFields>
6: <GeometryType>POLYGON</GeometryType>
7: <Schema>
8: <ElementType name="Row">
9: <AttributeType name="PROP_ZIP" label="Prop Zip" expression="S.PROP_ZIP"></AttributeType>
10: <AttributeType name="SOLDPRICE_SUM_L" label="Property Value Sum" expression="case when SUM(S.SALE_PRICE) is null then '' else PARSENAME(Convert(varchar,Convert(money,coalesce(convert(float,SUM(S.SALE_PRICE))/1000,0)),1),2)+'K' end"></AttributeType>
11: <AttributeType name="SOLDPRICE_AVG_L" label="Property Value Average" expression="case when AVG(S.SALE_PRICE) is null then '' else PARSENAME(Convert(varchar,Convert(money,coalesce(convert(float,AVG(S.SALE_PRICE))/1000,0)),1),2)+'K' end"></AttributeType>
12: <AttributeType name="SOLDPRICE_MIN_L" label="Property Value Minimum" expression="case when MIN(S.SALE_PRICE) is null then '' else PARSENAME(Convert(varchar,Convert(money,coalesce(convert(float,MIN(S.SALE_PRICE))/1000,0)),1),2)+'K' end"></AttributeType>
13: <AttributeType name="SOLDPRICE_MAX_L" label="Property Value Maximum" expression="case when MAX(S.SALE_PRICE) is null then '' else PARSENAME(Convert(varchar,Convert(money,coalesce(convert(float,MAX(S.SALE_PRICE))/1000,0)),1),2)+'K' end"></AttributeType>
14: <AttributeType name="SOLDPRICE_SUM" label="Property Value Sum" expression="case when SUM(S.SALE_PRICE) is null then -9999 else SUM(S.SALE_PRICE) end"></AttributeType>
15: <AttributeType name="SOLDPRICE_AVG" label="Property Value Average" expression="case when AVG(S.SALE_PRICE) is null then -9999 else AVG(S.SALE_PRICE) end"></AttributeType>
16: <AttributeType name="SOLDPRICE_MIN" label="Property Value Minimum" expression="case when MIN(S.SALE_PRICE) is null then -9999 else MIN(S.SALE_PRICE) end"></AttributeType>
17: <AttributeType name="SOLDPRICE_MAX" label="Property Value Maximum" expression="case when MAX(S.SALE_PRICE) is null then -9999 else MAX(S.SALE_PRICE) end"></AttributeType>
18: <AttributeType name="PROPERTY_CNT" label="Property Count" expression="count(S.SALE_PRICE)"></AttributeType>
19: <AttributeType name="SALEYEAR" label="Sale Year" expression="year(S.SALE_DATE)"></AttributeType>
20: <AttributeType name="SALEMONTH" label="Sale Month" expression="month(S.SALE_DATE)"></AttributeType>
21: <AttributeType name="LANDUSE_DESC" label="Landuse" expression="S.LANDUSE_DESC"></AttributeType>
22: </ElementType>
23: </Schema>
24: <GroupBy>S.PROP_ZIP, S.LANDUSE_DESC, YEAR(S.SALE_DATE), MONTH(S.SALE_DATE)</GroupBy>
25: <Filter>MONTH(S.SALE_DATE) = 9 and year(S.SALE_DATE) = 2010 and LANDUSE_DESC = 'SFR'</Filter>
26: <GeometryResource>POSTALCODELINK</GeometryResource>
27: <Links PATH="$(FULL_PATH)Links/LASALESAVERAGEPRICESOLD.xml">
28: <Link Name="POSTALCODELINK" Class="Dmp.Neptune.Links.KeyLink" ToResource="DMP_LICENSE/POSTALCODE">
29: <Operation>Equals</Operation>
30: <Pk>PROP_ZIP</Pk>
31: <Fk>POSTCODE</Fk>
32: </Link>
33: </Links>
34: </Layer>