PDA

View Full Version : Sort import Data on PaneLegend !



xonji
09-26-2011, 04:12 AM
Hi all,

Next post, maybe more luck ;).


I want to show all the Sales depending on zipcode at my Map.
I import a .csv file with the ImportData() Method and Say MapPoint with the "Array of Fields" Parameter from the ImportData() Method which column has data and which not.
How can i force MapPoint to sort my Sales to the related zipcode???

CODE:

object[,] fieldSpecifications = null;
fieldSpecifications = new object[2, 2];
//Welche Daten sind Geografisch welche nicht?...
fieldSpecifications[0, 0] = "Postcode";
fieldSpecifications[0, 1] = MapPoint.GeoFieldType.geoFieldPostal3;
fieldSpecifications[1, 0] = "Salesamount";
fieldSpecifications[1, 1] = MapPoint.GeoFieldType.geoFieldData;

//ImportData Methode, welche die Daten aus der .csv Datei ein ein bestehendes DataSet transportiert.
MapPoint.DataSet dataSet = myMap.DataSets.ImportData(fileInput,
fieldSpecifications, MapPoint.GeoCountry.geoCountryGermany,
MapPoint.GeoDelimiter.geoDelimiterSemicolon,
MapPoint.GeoImportFlags.geoImportFirstRowIsHeading s);

but the result isn't that good (look at the unsorted Panelegend, and circlesize):

Picture_of_Application (http://imageshack.us/photo/my-images/101/mappointapp.png/)

Thx 4 your help :)

best regards xonji :surrender:

Mattys Consulting
09-26-2011, 08:19 AM
Hi xonji,

You could try a territory map and assign each related zipcode a territory name.
Sized circles doesn't seem appropriate.

Eric Frost
09-26-2011, 03:38 PM
It's not super-simple, but maybe medium simple :-)

After import, you could loop back over the datasets, employ a simple sort algorithm, and copy/paste them back in the order you want.

Let us know how it goes!

Eric

xonji
10-11-2011, 08:48 AM
Thx 4 your reply,

The data is sorted by the SQL command it comes from.

then i write it into a .csv file and use the importData Method, cause i dont know how to fill a Mappoint dataset from a Oracle DB with usefull data, e.g. Location <> Sales ... :balloon2: