mapping

C# - IDataReader to Object mapping using generics.

How can I map a DataReder object into a class object by using generics? For example I need to do the following: public class Mapper<T> { public static List<T> MapObject(IDataReader dr) { List<T> objects = new List<T>(); while (dr.Read()) { //Mapping goes here... ...

Using Java and any external libraries, how can I draw latitude/longitude points onto a graphical representation of the Earth?

I'm currently using the Java Map Projection Library (I was able to obtain the code used for the Applet from the author and modify it for use in a desktop application - not sure if he linked to that on his website yet) to draw a map of the Earth in an application. However, I want to take this a step further. I have a set of latitude/longi...

A @Embeddable that behaves like a @OneToOne (HIBERNATE)

Hi, I have a class named Parent as follows @Entity public class Parent { @Id @GeneratedValue private Integer id; @Embedded private Message message; } DBA (minimal OOP knowledge) has designed both Parent and Message properties in PARENT table. Message class behaves like a @OneToOne mapping because, at some cases...

Using sharp architecture and subclassing entity

I've been trying to use #harp architecture and Fluent-NHibernate. I am trying to sublass off of SharpArch.Core.DomainModel.Entity since I have some entities in my domain model that must have a unique name. public abstract class UniqueNamedEntity : Entity { protected UniqueNamedEntity() { } protected UniqueNamedEntity(stri...

Programmatic map area/location finding / restriction

(Sorry, I couldn't come up with a better title - please feel free to suggest a better one in the comments.) I'm looking for a way to provide a set of rules, and have specific areas/locations included/excluded based on these rules. The ideal end result of the rules being a map showing excluded areas, and perhaps a way to extract to text...

Nhibernate mapping in asp .net

I am a newbie in NHibernate.I am facing problem in mapping file.I have 2 tables Fetures and Priority. Feature FeatureID(PK),FeatureName,PriorityID(FK) Priorty PriorityID(PK),PriorityName I want to bind a grid to Feature table but but grid should contain PriorityName rather than PriorityID. I have tried one-to-one,many-to-one and ba...

How do you map a List<string> in iBatis?

I have a class like this public SomeClass { private List<string> _strings = new List<string>(); public IEnumerable<string> Strings { { get return _strings; } } } How would I do the mapping for _strings? I tried this, but it complains about the List typehandler not being found, which it doesn't complain about if I ...

NHibernate collection mapping throws 'could not load or initialize object or collection'

Hi, I've got following mappings: <bag name="BList" table="A_TABLE" inverse="true" lazy="false" cascade="all-delete-orphan"> <key column="A_ID"/> <one-to-many class="B, Model" /> </bag> And <many-to-one name="A" class="A, Model" column="A_ID" not-null="true" /> Performing insert and up...

Convert ESRI projection coordinates to lat-lng

I have a large dataset of x,y coordinates in "NAD 1983 StatePlane Michigan South FIPS 2113 Feet" (aka ESRI 102690). I'd like to convert them to lat-lng points. In theory, this is something proj is built to handle, but the documentation hasn't given me a clue -- it seems to describe much more complicated cases. I've tried using a python...

Anyone know an embedable map widget that can be posted to anonymously

I am trying to embed a map widget into a wordpress blog. Visitors to the blog should be able to place a marker on the map and others should be able to view places that other people have marked. It should not require people to log in before placing a marker. Can anyone recommend such a service? ...

Mapping with NHibernate?

I have following classes in my domain model: public class Player { public virtual string ID { get; set; } public virtual string Name { get; set; } public virtual List<Match> Matches { get; set; } } public class Match { public virtual int ID { get; set; } public virtual Player Player1 { get; set; } public virtual...

How can I find if a lat long coordinate is valid in a coordinate system?

If I have a point in latitude/longitude and I want to find out if it is a valid for use within a particular coordinate system, how can I do it? As an example. Say I am working in Swiss Grid (CH 1903, EPSG 21781) and have a point representing something in London in the UK, I want to know if that point is valid in the Swiss Grid coordinat...

Local data sources for GIS Map plugin?

I am developing an ASP.NET intranet application that needs to have an interactive map interface. There are some pretty neat Silverlight mapping plugins that I think could work well, specifically: ArcGIS Silverlight API: http://resources.esri.com/arcgisserver/apis/silverlight/ DeepEarth mapping framework: http://www.codeplex.com/deepe...

Is it possible to map multiple tables to a single domain model using NHibernate?

Is it possible to map multiple tables to a single domain model using NHibernate? It's basically a UNION, something like shown below but I am not sure how to do the domain models in C# and mappings of NHibernate. I basically have 1 abstract class and 2 concrete classes. Each concrete class can be mapped to a single table in the databse....

How can I get latitude, longitude from x, y on a Mercator map (JPEG)?

I have a Mercator projection map as a JPEG and I would like to know how to relate a given x, y coordinate to its latitude and longitude. I've looked at the Gudermannian function but I honestly don't understand how to take that function and apply it. Namely, what input is it expecting? The implementation I found (JavaScript) seems to t...

MKMapView questions

I've been working with the MKMapView control (SDK v3.0) in the simulator for a few days. I have been able to map an arbitrary location, zoom it, drop a pin, and add an annotation. I'm still a bit fuzzy on the full capabilities of the MKMapView control itself (outside of the simulator), however. If the MKMapView's 'Shows User Location'...

Mapping obj-c object to sqlite database

Hello Im looking for a simple (if I can call it that) mapping tool for obj-c, that maps objects and their relationships to a sqlite database. Is there any out there that acts like db4o for java? I havent found anything on google, and I think its because Im not completly sure of where to look and what to look for. Hope someone can help, ...

what are good libraries for map feature?

we are planning to have feature similar to Google maps like feature in our commercial desktop application. can anyone suggest any such map libraries? this application needs both drawing facilities and features that would help in showing the map too. the application will be in C# and hence if the libraries need to be .NET based. ...

Converting from longitude\latitude to Cartesian coordinates

I have a earth coordinates given as longitude and latitude (WSG-84). How you i convert them to Cartesian coordinates (x,y,z) with the origin at the center of the earth? ...

How do I dynamically add points to a Google Map when the bounds change?

I can currently place static points in the map window: var latlng = new GLatLng(lat, lng); map.addOverlay(new GMarker(latlng, markerOptions)); And I know how to get the bounds of the window. I can also code a page that will take the bounds and return the points that are inside them in any format. The problems I have now: Does the ...